Unicode, encodings, and asian languages: need some help.

A

apprentice

Yes, credits. One line or 5000, it does not matter.
When 3 lines of my code do the job right and replace 40 lines of your code
that do not, then yes, you should give credit.

I see that you still do not understand. Your 3 lines of code really solve
nothing.
Your code does not even work. Production and consumption of a RTF document
may very well happen on different systems. I may not count on the fact that
the system that generates the document supports the given foreign language.
Programming is about quality, not quantity.
Maybe as an "apprentice" you did not know that.

I've got 22 years of sw development on my back. And yes, even after 22 years
I still consider myself an apprentice.
Yes, this is what I am mean.


Read the RTF specs.

I've read the specs. And I've not found anything that confirms what you are
stating.
To my knowledge there are only a few control words that play a role in this
matter: \ansicpgN (or \ansi, \mac, \pc, \pca) and those used in the font
table (\fcharset and \cpg). As long as the \ansicpgN control words specifies
the correct codepage (i.e. 932 for japanese) I don't see why it would not be
correct to use the encoding corresponding to codepage 932 (i.e. ISO-2022-JP)
to encode the bytes and then print them with the \' format.
Then you cannot count on a client system to handle Asian languages.
It is unrealistic to ask for Japanese without Japanese support from the
OS.
Unless you want to do everything from scratch and carry all the data with
you (like ICU).

As I said above, I may have to generate an RTF doc on a system to be sent to
someone else who will open it on another system.
An example of the above would be an e-commerce platform that generates
purchase documents for customers around the world in their own native
language.
I see nothing so suprising in this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top