Re: [poedit-users] Character encoding issue
Scott Hildebrand <klezmer41-/[email protected]> Wed, 4 Feb 2009 21:42:54 -0800 (PST)
| Newsgroups | gmane.editors.poedit.user |
|---|---|
| Message-ID | <[email protected]> |
You're totally right Vaclav, PoEdit seemed to be working correctly. SciTE (text editor) was showing the files in 8-bit by default, but changing to UTF-8 showed the real deal.
I do pay attention you jackass. Maybe you can try being nice for once?
I'm stuck on a Windows XP box at the moment because the Linux box is down, and I've found that most of this comes down to PHP being picky.
This works on Windows and I'll try on Linux later...
And I mean really really picky, I've tried many configurations of these different PHP functions.
$locale = "fr_FR.UTF-8";
$gettext_domain = 'messages';
setlocale(LC_ALL, $locale); // dir name will still be fr_FR
putenv("LC_ALL=$locale");
bindtextdomain($gettext_domain, "./locale");
textdomain($gettext_domain);
bind_textdomain_codeset($gettext_domain, 'UTF-8');
--- On Mon, 2/2/09, Vaclav Slavik <[email protected]> wrote:
> From: Vaclav Slavik <[email protected]>
> Subject: Re: [poedit-users] Character encoding issue
> To: [email protected]
> Date: Monday, February 2, 2009, 12:32 AM
> Hi,
>
> On Sun, 2009-02-01 at 17:10 -0800, Scott Hildebrand wrote:
> > I'm using poedit on Windows trying to do some
> French translations. In
> > poedit when I type an é character, and save as UTF-8,
> it saves as é.
>
> This sentence doesn't make any sense. UTF-8 is text
> encoding. As any
> text encoding, it translates characters ("é")
> into *sequences of
> numbers* ("C3 A9" in hexadecimal = "195
> 169" in decimal). Obviously,
> "é" is not a sequence of numbers -- to say
> that UTF-8 encodes anything
> into that, that's just talking nonsense.
>
> Of course, what you meant (or should have meant) to say was
> that when
> you open the .po file in some -- unspecified, despite bug
> reporting
> guidelines asking for maximum specificity! --text editor,
> it shows up as
> "é" in said editor. You make the unwarranted
> and entirely unreasonable
> assumption that when two programs are involved in correctly
> handling
> the .po file, it is Poedit -- the one of them that
> specializes in .po
> files -- that got things wrong. This assumption is wrong.
>
> You need to realize that *every time* a piece of text is
> stored in a
> file, it is saved as sequence of numbers. In order to
> properly load the
> text back, you need to know two pieces of information: said
> numbers
> *and* knowledge of the *encoding* used to save them. This
> may be
> implicit, or it may be stored somewhere in the file (as in
> the case
> of .po files; this requires the app to understand the
> file's format!),
> or you as the user may be required to provide this
> information.
>
> So what happens here is that whatever tool you used to
> inspect the file
> got the encoding wrong (this is not surprising, why should
> it know how
> to deal with .po files?!). Specifically, it interpreted the
> file as if
> it was stored in ISO-8859-1 or CP1252 encoding -- these
> happen to encode
> the text "é" as "195 169", which
> should sound familiar to you if you
> paid attention.
>
> > Anybody have an idea how to make UTF-8 work and save
> correctly?
>
> Poedit handles UTF-8 just fine. The problem is entirely on
> your side.
>
> Regards,
> Vaclav
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
> Poedit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/poedit-users
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com