i18n support.

Started by
5 comments, last by ugenn 21 years, 11 months ago
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?
Advertisement
quote:Original post by ugenn
pps: does VS.net spport the C99 specification?


No.

--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
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?
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.
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?
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?

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 ]

This topic is closed to new replies.

Advertisement