RE: Special Encoding
George Rhoten <[email protected]>
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <OF21A6B3ED.CED19E86-ON86256D98.007D119F-88256D98.007EEAA0@us.ibm.com> |
It looks like you're using a char * string to get your resource. Is that string in UTF-8? Is the output in UTF-8, and did you label it as such in the HTML or XML? If you would like to make sure that your browser is setup correctly, try this page: http://oss.software.ibm.com/cgi-bin/icu/lx/en_US/utf-8/?locale_all& Except for Divehi and a few characters in Azerbaijani, Hawaiian and Kazakh, the characters appear to display correctly on my Windows 2000 machine. If you can display that page from LocaleExplorer, then I have a feeling that you are corrupting the data somewhere along the way before displaying the output in Internet Explorer. Just at a quick glance, you may be mixing the encodings from the two cout statements. The first set of couts may be in the default codepage, and the second set of couts may be in UTF-8 and interpreting it as being in the default codepage. I'm presuming that the default codepage isn't UTF-8. George Rhoten IBM Globalization Center of Competency/ICU San José, CA, USA "Sinha, Vineesh" <[email protected]> Sent by: [email protected] 09/05/2003 02:29 PM To: "Steven R. Loomis" <[email protected]> cc: <[email protected]> Subject: RE: Special Encoding Thanks a lot for the prompt response. Let me put my question more clearly. In this particular application, xml needs to be generated for all user actions. For instance, if the user creates a table of data, that table needs to go into the XML. For all user activity, I'm building a DOM tree using Xerces, and when the appropriate request comes, I serialize this DOM tree to a file. This application is localized by having key-value pair kind of set up. The code has keys in it, and depending upon the output language setting for the application, the corresponding value is picked from the appropriate language file. To cut the technical jargons, it can be assumed that if the application output language is English, en/MyFile.txt is used to get the value for key, and if German is the preference, de/MyFile.txt is read. The key-value file, MyFile.txt, exists for each supported language, and has language specific localized text for the values of the key. I tried getting the output as preformatted texts in html file as well, but the texts are not displayed appropriately in the browser. I'm working on a system with Microsoft Windows XP Prefessional Version 2002 (Service Pack 1). The browser is Microsoft Internet Explorer Version 6.0.2800. All I'm seeing in my editor (and browser) is garbage. I have the required fonts, and I can see the desired texts when typing directly from keyboard. The text written programmatically is not what I expected. -----Original Message----- From: Steven R. Loomis [mailto:[email protected]] Sent: Friday, September 05, 2003 4:05 PM To: Sinha, Vineesh Cc: [email protected] Subject: Re: Special Encoding I don't quite understand what's going on here, but let me see if I can ask some things... What is GetLocalisedString(), what is the encoding of the std::string it returns? the ICU Locale::setDefault() does not affect non-ICU services. Rather than changing the default locale, I would recommend that you maintain a Locale parameter as a variable, and change/use that rather than changing the default. Other than the use of uloc_setDefault() it seems like your questions have more to do with Xerces than ICU. What do you mean by 'not good encoded chinese strings' at the end? If all of the data is to be UTF-8, why is there a question with the encoding? Regards, Steven On Friday, September 5, 2003, at 01:41 PM, Sinha, Vineesh wrote: > Hi, > > I'm struggling to get the right encoding for the localized text. ... _______________________________________________ icu mailing list [email protected] http://oss.software.ibm.com/developerworks/oss/mailman/listinfo/icu