Boost logo

Boost Users :

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


>
> >
> > I still think that Christoph is raising a valid issue. Even if you
> > keep the file names as utf-8 strings, diagnostic_information doesn't
> > know about it. I think it is possible for boost::errinfo_file_name to
> > deal with the situation better, it is on my todo list.
>
> what do you have in mind? Currently the only idea I have is to treat
> all utf-8 characters < 128 as ascii characters and escape the rest.
>

Ha! More than a decade ago when I made my exception class (for Windows development) that dealt with adding key-value pairs in an extensible way, it was wchar_t from the getgo. I had to convince developers to use wide chars throughout, since that is what Windows wants. File names and registry keys are Unicode, and user input will be Unicode, and all that shows up in the error message.

IMO, the exception class should take UTF-16 as wstring or L literals and "deal with it" internally if need be. As long as it produces the original value again when queried, the internal format does not matter.
(In my old implementation, performance when adding was a consideration though)

--John



(beware of footer!)

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