Re: Two questions



Carlos Perelló Marín <carlos@gnome-db.org> writes:

To convert a .po file to UTF-8 use something like the following code
(tested with iso-8859-1 and EUC-KR); I guess you already wrote such a
script:

#!/bin/sh
# po2utf8.sh
po=$1
charset=$(sed -n -e '/^"Content/{s/.*=\(.*\)\\n"/\1/;p;q;}' "$po")
sed -e 's/^\("Content-Type:.*=\).*/\1UTF-8\\n"/' "$po" \
  | iconv --from-code $charset --to-code=UTF-8
# po2utf8.sh ends here

Once gettext-0.11 is released, please use 'msgconv'.

> If you have a way to do it when you do the "make install" then it's
> perfect to me.

It must happen a little bit earlier; at .mo file creation time.  In
po/Makefile.in.in look for the .po.gmo target and replace $(GMSGFMT)
basically with

    po2utf8.sh $po | msgfmt -

You can quickly check the result running 'msgunfmt' on the .mo file.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)



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