1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

View uses Windows-1252 codepage instead of System codepage

Discussion in 'Support' started by gschizas, Sep 14, 2011.

  1. gschizas

    Joined:
    May 30, 2008
    Messages:
    81
    Likes Received:
    0
    View (v.exe) seems to have Windows-1252 as hardcoded system codepage. I'm viewing some (ANSI) files that have Greek characters in them, and instead of the standard Greek (codepage 1253), I'm seeing characters from codepage 1252 (mostly vowels with diacritics).

    The workaround is obvious, switch to Greek (1253) encoding, but "use system codepage" is misleading, or even wrong. "Use System codepage" should use the actual system codepage, as is demonstrated by e.g. opening the same file with Notepad. Thankfully the encoding persists between sessions, so that's not so big a deal after all.

    Weirdly enough, the DOS/OEM code page uses the correct OEM codepage (737 for Greek).

    Finally, there is no Codepage 437 encoding. Instead, the only Western European DOS/OEM option is the less common Codepage 850.
     
  2. gschizas

    Joined:
    May 30, 2008
    Messages:
    81
    Likes Received:
    0
    Some more information: This also happens with the standalone V (from http://www.fileviewer.com/, version 12 SR1), so this is in fact Charles Prineas' problem.
     
  3. FileViewer

    Joined:
    Aug 3, 2011
    Messages:
    37
    Likes Received:
    0
    Γεια σου Γιωργο.

    VIEW should use the system code page.

    If you right-click on ANS in the status bar and select "Character Encoding" is "Default" enabled or 1252?

    If Default is enabled, can you send a sample file to v at fileviewer dot com so I can use for testing?

    I will include it in the next release.

    Thanks,
    Charles.
     
  4. gschizas

    Joined:
    May 30, 2008
    Messages:
    81
    Likes Received:
    0
    Default is enabled. I've sent you a zip file with a very small text file that demonstrated the behavior (I've zipped it to avoid any mail mangling that could occur in the way). I've also attached it to this post - it's just 388 bytes, so I don't think it will be any problem for the forum :)

    Of course, if I manually select Greek (Windows-1253) from the status bar, it displays properly (and it is even persistent), so it's not a breaking bug :)
     

    Attached Files:

  5. gschizas

    Joined:
    May 30, 2008
    Messages:
    81
    Likes Received:
    0
    Some more information (I've sent them by email, but they could help others sometime :))

    I'm using Windows 7 64-bit, with English UI and Greek regional options (these are distinct settings, and should not be confused):

    C:\Users\GSchizas>echo %@winapi[Kernel32.dll,GetUserDefaultUILanguage]
    1033

    C:\Users\GSchizas>echo %@winapi[Kernel32.dll,GetUserDefaultLCID]
    1032


    1032 is Greek (el-GR), 1033 is US English (en-US)

    It's quite common, unfortunately, to confuse those two settings, although usually it's the other way around. For example 7-zip reads the LCID as Greek, and mistakenly assumes that I want to see menus etc. in Greek. The result is that I have a right click menu with all options in English, except the ones for 7-zip which are in Greek.

    In conclusion:
    • To decide which language your menus should be in, use GetUserDefaultUILanguage
    • To decide how you will print numbers, dates, etc., or what code page your text should be in, use GetUserDefaultLCID
    • Actually, to find out the default ANSI codepage, just use GetACP, as shown below:
    C:\Users\GSchizas>echo %@winapi[Kernel32.dll,GetACP]
    1253
     

Share This Page