Unicode Chars with C/C++

Started by
9 comments, last by GameDev.net 18 years, 4 months ago
Hello ppl :) I have some questions about unicode stuff on C/C++ :P The true is that i didnt search google very much cause i dont have time. But from that little i have search i have some questions... I want to make a cross platform 3DGameEngine, but i read that windows uses UTF-16 and Linux uses UTF-8.. so.. Do I need write different code? there is not some way to use only UTF-16 or only UTF-8 for both (Win,Linux) platforms? Can I use standar characters for the 3D Engine and Unicode characters for the Game Engine? or all the project must use the same? what is better to use.. char* (the unicode version.. something like w_char if i remember right) or string (the unicode version.. something like.. wstring)? plz keep in mind that i want the Engine to be cross platform. do you have any tutorial to suggest for starting? thanks for your time guys! :D
Advertisement
Decide on one as your internal format and use a conversion library when you need to read or write text somewhere else.
are you sure linux uses utf 8. Our experience is that linux and OS X both use UCS 4( 32 bit unicode characters).

We use unicode 16 for windows/OS X and linux. We just ported CAtlString to the Mac and LInux and use that for all our character maninpulation. Of course that means good by stdC++ library:)

That may not be acceptable to you though:)

Cheers
Chris
CheersChris
I personally rely on ICU for most of my Unicode needs.
We also use ICU for when we need conversions:). Its always great when you can find code that just works for you!!! I'd definitely recommend it!

Cheers
Chris
CheersChris
Is this Free (for commercial and non-commercial projects) and cross platform?
Are you referring to ICU? Yes, it's free and cross platform; it's distributed under the X license and has been ported to a large number of different platforms.
sounds really good :) I check it a little but i didnt find any tutorial :/ only some papers with technical info and staff about unicode chars :/
any ICU tutorial on the internet? Google didn't help me. :(
The download page has the documentation as a zip file.
now exept this.. ICU..
I dont know.. is there any tutorial apout unicode support in C/C++? i cant find anything! :(

some one to give me a simple example? I just want to print a string with greek characters. nothing more!

i tried this:

wchar_t str = L"καλημέρα"

wcout<<str;

but nothing :/

btw: I use MSVStudio .NET 2005

thanks

This topic is closed to new replies.

Advertisement