Archived

This topic is now archived and is closed to further replies.

ugenn

i18n support.

Recommended Posts

ugenn    122
Anyone here has experience programming for i18n? Not necessasarily game-related code, but in general. Is it possible to (realistically) write one set of code that works for different character sets (sbcs, mbcs, wide)? Supporting sbcs and wide character sets is simple enough by hiding the char/wchar_t behind an opaque type but when adding support for mbcs, all sorts of issues creep in (searching for character positions etc etc). What''s a good way to implement transparent support for mbcs? What are some of the other pitfalls one should be aware of? ps: does C99 define the exact sizeof a wchar_t or is it implementation defined? pps: does VS.net spport the C99 specification?

Share this post


Link to post
Share on other sites
JonStelly    127
Well, you''d really have to be careful about working with strings, but it''s possible. I had to i18n a few projects for my company''s big i18n push a couple years ago. My question would be, why would you need to supply a sbcs AND mbcs version? One or the other would work, no?

Share this post


Link to post
Share on other sites
ugenn    122
quote:
Original post by JonStelly
Well, you''d really have to be careful about working with strings, but it''s possible. I had to i18n a few projects for my company''s big i18n push a couple years ago. My question would be, why would you need to supply a sbcs AND mbcs version? One or the other would work, no?


I wasn''t referring to binary executable but source code.

Share this post


Link to post
Share on other sites
rkazuhiro    122
How can I find out more about MBCS? I don''t realy want to buy another book, as they are always so expensive. Is it a really simple thing to work with in windows?

Share this post


Link to post
Share on other sites
ugenn    122
quote:
Original post by rkazuhiro
How can I find out more about MBCS? I don''t realy want to buy another book, as they are always so expensive. Is it a really simple thing to work with in windows?


Visual C provides the mbc* or mbs* functions for handling mbcs strings. But based on my personal experience (< 1 weeks), MBCS can be very troublesome to handle and can introduce all kinds of subtle bugs into your application if you''re not careful, especially if you''re used to programming fixed-byte strings.

ps: are the wide char functions (wcscpy wcscat etc) defined in the pre-C99 Standard?

Share this post


Link to post
Share on other sites
Kylotan    9853
I don''t think it''ll help you in this case, but C++ seems to have good support for numerous locales, and due to the templated nature of the strings and streams, most of this is totally transparent to the user.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions ]

Share this post


Link to post
Share on other sites