This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: UTF-8, UTF-16 and UTF-32


On Thu, 21 Aug 2008 14:43:19 +1000
"Dallas Clarke" <DClarke@unwired.com.au> wrote:

> I have had to spend the last several days totally writing from scratch the 
> UTF-16 string functions, and realise that with a bit of common sense every 
> thing can work out okay. Hopefully quick action to move wchar_t to 2 bytes 
> and create another type for 4 byte strings, we can see a lot of problems 
> solved. Maybe have UTF-16 strings with L"My String" and UTF-32 with LL"My 
> String" notations.
> 

Try -fshort-wchar, this will make wchar_t 2 bytes long.

I also suggest writing your own string class that is portable, instead
of relying on Windows/Linux libraries. That will avoid incompatibilities
while at the same time give you a much more powerful tool.

That said, I strongly agree with your sentiment that Windows and Linux
could be closer to each other, and the sentiment "it's the standard,
it's not going to change" pushes me to the ceiling too.

j
-- 
John Gateley <gateley@jriver.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]