Jump to content
  • Advertisement
Sign in to follow this  
Unreal

Unicode Chars with C/C++

This topic is 4859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Decide on one as your internal format and use a conversion library when you need to read or write text somewhere else.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. :(

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!