Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][exception] Wide-character design considerations
From: John Dlugosz (JDlugosz_at_[hidden])
Date: 2010-06-24 11:28:25


 
> > System functions take the "system code page" which might be different
> for file-name related functions, but did not support UTF-8 in the
> historical Windows line, but appears to be there for modern versions.
>  But, lots of code was written to support Windows 95 and is still out
> there.  Actually, I don't know if passing UTF-8 to the Windows API-A
> functions work!  Normally, one uses the UTF-16 (-W) forms.
>
> No, it won't work, the non-W Windows functions don't understand UTF-8,
> and the -W functions use UTF-16.

Even when the code page is set to UTF-8? I thought the -A forms are wrappers that call MultiByteCharToWideChar on the arguments and then call the -W forms. So anything that function works with should work.


>
> > So, making the human-reportable string be UTF-8 is simply not going
> to sit well with Windows programmers.  Make it UTF-16 and I can pass it
> to wcout<< or call TextOut, OutputDebugString, etc. with no problem.
>
> Right, but UTF-16 won't sit well with non-Windows programmers. :)

After more reflection, I think a more complete answer is that the narrow-string function should not blindly return UTF-8, but should reflect the current locale setting.

--John




TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net