unicode - Using AppLocale with Labview in Windows 8

08
2014-07
  • qianlong

    I am running LabVIEW 2013 Dev Environment on a Chinese Windows 8 platform. LabVIEW is not a Unicode-base program, and consequently on Asian Windows there are display issues for our interfaces created with US-English character sets. I can fix this problem by setting the language settings for non-unicode programs to English. This works fine, except that all my other non-unicode-based programs are totally illegible.

    A quick google search turned up Microsoft's utility for running application with a user-specified code page, AppLocale. The utility is only written to be compatible up to Windows XP. There are two suggested methods I ran accross for installing it: 1. run installer using compatibility settings 2. install using command prompt with admin privileges (apparently it doesn't play well with UAC. You can find one set of instructions here for installing AppLocale on Windows with UAC.

    Unfortunately, nothing I have tried has been able to get LabVIEW to use the code page I would like it to. When I run LabVIEW through AppLocale and open the user-interface I am concerned about, the characters still do not display properly.

    Any ideas what I might be doing wrong? Could there be a fundamental incompatibility with LabVIEW? Does anyone know of an alternative to AppLocale that might work for me?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    Using Windows cmd.exe and a batch .cmd, can I copy/xcopy/??? a Unicode filename from x:\* to y:\*
  • Peter.O

    I want to do a very simple thing: Copy a file.
    Copy is a simple (and fundamental) command. It should be easy, but it seems to be complicated when it comes to Unicode filenames (using English XP, cmd.exe, and a .cmd script).
    I have managed to create a .cmd file with the Unicode filenames, as follows

        :: To create the final .cmd script
        :: 
           set SRCE=D:\_cmd\cpp
           set DEST=H%SRCE:~1%
    
           cmd.exe /U /c DIR /A:-D /s /b "%SRCE%" >"SRCE.UTF16" 
           cmd.exe /U /c DIR /A:-D /s /b "%DEST%" >"DEST.UTF16" 
    
           ConvUTF.exe  1628 "DEST.UTF16" "DEST.UTF-8"
           ConvUTF.exe  1628 "SRCE.UTF16" "SRCE.UTF-8"
    
        :: Then, with `sed.exe`, `diff.exe`, and `ConvUTF.exe` again...
        :: the resulting UTF-8 (or UTF16) .cmd file looks like this...
        :: 
           copy "D:\_cmd\cpp\ā.क.test" "H:\_cmd\cpp\"  
    

    The copy command works fine when I run it directly at the command prompt, but fails, when used in the .cmd script.
    The UTF-8 .cmd errors out with: The system cannot find the file specified
    The UTF16 .cmd doesn't get past the first NULL-byte (of the first character), and just exits.

    Is there some way to do it from a .cmd script? (I want to use the cmd.exe shell)
    Perhaps there is a utility program which can be called from my .cmd...
    All suggestions are welcome.

    PS. To clarify the manin issue... I don't care about how Unicode filenames display in the console window (That just doesn't happen for most non-latin-based letters in the cmd.exe window)... I am only interesterd in being able to copy a file which has Unicode letters in its filename- via a batch .cmd "script".


  • Related Answers
  • Јοеу

    Save the UTF-8 batch file without the BOM at the start which will trip up cmd. Also, cmd isn't really Unicode-aware when it comes to batch files. You should put

    chcp 65001
    

    into the batch at the beginning to switch to UTF-8 which should enable your Unicode characters to be read and processed correctly. The only downside is that this change persists even after the batch file exited and thus you're stranded with the shell in UTF-8. You can save the previous code page and restore it at the end if this poses a problem.

    Also changing the console font to a TrueType font might help since several internal commands are known to exhibit Unicode problems with raster fonts (a reason why for /f over dir is such a stupid idea generally).