[Top][All Lists]

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

Re: xgettext outputs UTF-8 is --from-code=iso-8859-1

From: Laurent Martelli
Subject: Re: xgettext outputs UTF-8 is --from-code=iso-8859-1
Date: Wed, 16 Mar 2005 18:09:36 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/20.7 (gnu/linux)

>>>>> "Bruno" == Bruno Haible <address@hidden> writes:

  Bruno> Laurent Martelli wrote:
  >> I have a string to translate which contains `×' (multiplication
  >> sign, 0xD7 in iso-88859-1).

  Bruno> In programming languages such as C or C++, you then have to
  Bruno> make sure that when the string has not been handled by the
  Bruno> translator, and the user is operating in a locale with
  Bruno> different encoding (such as UTF-8), you convert the string to
  Bruno> the appropriate encoding. Otherwise the user will see garbage
  Bruno> on his screen.

  Bruno> A way to avoid this is to keep the strings in the source in
  Bruno> ASCII, and use an en.po file to convert the ASCII "x" to the
  Bruno> multiplication sign.

I'm using PHP and the string is HTML so I used the HTML entity &times;
as a workaround. Since iso-8859-1 is the default encoding for web
pages, I do not have to care about the problem you state.

  >> So I used --from-code=iso-8859-1 with xgettext, but as a
  >> consequence it now outputs UTF-8. And it does not understand
  >> --to-code. So it seems there's not way to get an iso-8859-1
  >> encoded po file in this case.

  Bruno> This is on purpose. The xgettext output is used as starting
  Bruno> point for the translators. But a Japanese or Russian
  Bruno> translator cannot add her translations to an ISO-8859-1
  Bruno> encoded file. So she would have to transcode it to UTF-8
  Bruno> first before she can start working on it.

I understand. And I guess this is were msgconv can be used before
msgmerge so that for instance fr.po is kept in iso-8859-1. I guess I
had not read enough of those fine manuals.

Thanks for the quick answer,

Laurent Martelli
address@hidden                                Java Aspect Components
http://www.aopsys.com/                          http://jac.objectweb.org

reply via email to

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