On 17.04.2004 22:33, Upayavira wrote:
A few I18N questions:
1) I have some polish text that uses character entities, such as "się" How can I translate this into a single or double byte character in either ISO-8859-1, ISO-8859-2 or UTF-8?
They are not translated. While you have the entity representation in the XML files, you have characters in Java. Only the serializer decides whether it puts them out as character or character entity. In general this can't be influenced, but the one or the other serializer might have configuration options for this. But at the end (i.e. in the browser or where ever) it should work for both the entity and the character as they represent the same "thing".
The problem is when I want to generate text which will be showed in javascript alert. When it contains entity representation of the characters, text in the message box is escaped and the entity representation is showed. At least in the IE.
2) I can set the encoding of a page in the serialiser configuration. How do I deal with the situation where the best encoding depends upon the language, which means that the encoding should be chosen based upon the encoding of a source file?
That's not possible. As written above you have more or less encoding-neutral characters in Java (obviously not completely as somewhere in the memory they are also just bytes). But at least they are independent on the encoding of the original file. You do not know in which encoding the XML file was. You have to decide the serializer's encoding only based on the possible character range. If it's strewed over the ISO char sets better use UTF-8 in general. Another option would be to use a selector based on user's locale which chooses the serializer (with a specific encoding).
Thanks for your help!
Those i18n ignorant English men! ;-)
Joerg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Jaroslav Kuruc [EMAIL PROTECTED] FIIT STU, D208 Ilkovic(ova 3 842 16 Bratislava 4
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
