RE: inconsistent behaviour in windows

From: Peter Constable (petercon@microsoft.com)
Date: Thu Feb 19 2004 - 11:07:54 EST

  • Next message: Michael Everson: "Re: Arabic Characters for Kurdish are missing"

    > From: unicode-bounce@unicode.org [mailto:unicode-bounce@unicode.org]
    On Behalf
    > Of Deepak Chand Rathore

    > I am creating new tasks using CreateProcessA(), and i want all the
    arguments
    > to be passed unchanged.

    > Similar behavior is observed with other hex values
    > (\x81,...) which are reserved by windows in code page 1252. But such
    hex
    > values can occur in my argument list as it is utf8 encoded.

    By definition, string parameters passed to CreateProcessA() are encoded
    in an "ANSI" code page. This would be the system codepage, which is
    determined from the system locale setting. There is no locale that has
    UTF-8 as its ANSI codepage.

    Command lines are either going to be interpreted in terms of an ANSI
    code page (Win9x/Me systems) or UTF-16 (WinNT/2K/XP). Nobody should be
    creating console apps that take UTF-8 as command line arguments.

    I recommend that you switch to CreateProcessW(). Either that, or get the
    author of utf8.exe to accept a transfer encoding syntax such as you've
    used in your email -- "\xea\xb1\x9d" -- which you'd be able to pass
    regardless of the encoding used in the command line.

    Peter
     
    Peter Constable
    Globalization Infrastructure and Font Technologies
    Microsoft Windows Division



    This archive was generated by hypermail 2.1.5 : Thu Feb 19 2004 - 11:52:35 EST