Re: C++ and internationalization/localization
kasthurirangan.balaji@gmail.com wrote:
I am looking for advice on i18n/l10n using c++. I understand about
wchar & wstreams. I have gone thru the net for some knowledge. All
speak of encodings like utf8/utf16/iso8859 and so. I also see that by
using utf8, we can achieve i18n and l10n using char itself. It would
be great if someone can provide or point out resources in c++ with
lots of example programs. Books are also welcome. References should
speak of persistence, network communications.
I have localized several games over the years, you can often get away
with single byte, depending on what languages you are localizing for.
For example, my current programs all use Latin-9 and are localized for
English, Spanish, French, German, Italian, Danish, Dutch, Norwegian, and
Swedish.
Of course, if you have to support Asian character sets, then double byte
is practically a must. The best thing, IMO, is to come up with an
interface for dealing with strings that has a UTF-16 (or maybe even a
UTF-32) interface, then write several classes that all implement that
interface but store the data internally in some other, possibly more
compact, format like UTF-16, UTF-8 or even Latin-1 or 9. That way, you
can switch out encoding formats with just a recompile and measure which
one makes the best use of resources.
One thing I haven't had to deal with is right to left or up to down
issues. The two Japanese titles I have done accepted left to right text
display without complaint.
My current batch of localization are on the Nintendo DS which has two
rather small screens (256 x 192) which limits the amount of text that
can be displayed on one line. On one of the titles, I am limited to 17
characters per line in dialog, and many of the other text bits are
limited to 10, and sometimes even 8 characters. This has proven quite
difficult in some languages. Of course these kinds of issues probably
aren't a problem with Windows systems and I know they aren't an issue
with Mac systems.