nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nuxeo-localizer] Charater Set Conversion


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] Charater Set Conversion
Date: Fri, 26 Jul 2002 10:47:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Debian/1.0.0-1

Hi Calvin,

Do you mean you upgraded to the last CVS version ?

Well, you'll have to write an script, it would be something like:

 mc = ...
 for msg in mc._messages.keys():
     for lang in msg.keys():
         # From iso-8859-1 string to unicode string
         unicode_str = unicode(msg[lang], 'iso-8859-1')
         # From unicode string to utf8 string
         utf8_str = unicode_str.encode('utf8')
         # Store the unicode or the utf8 string, as you prefer
         msg[lang] = ...


From unrestricted code (external method).

If you've upgraded to the last CVS version, you will probably need to
use either Zope 2.6 (last version is alpha 1) or to apply the unicode
patches from Toby Dickenson (http://www.zope.org/Members/htrd/wstring).
If this is the case, it's better to store the translations as unicode
strings than normal strings encoded in utf8.


Regards,
david


Calvin Hendryx-Parker wrote:

Hi,

Is there an easy way to convert a MessageCatalog that was created using iso-8859-1 to UTF-8? I upgraded, but the exsising strings are still in the old charater set and I wouldn't mind using the Unicode one.

Thanks

Calvin


--
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software





reply via email to

[Prev in Thread] Current Thread [Next in Thread]