Samy RABIH | 2 Jan 2009 11:45
Picon
Favicon
Gravatar

[poedit-users] Find which file is not UTF-8 convertable

Hi

I'm a long time user of PoEdit (for Zenphoto.org project) and sometimes we got the following problem : when PoEdit updates his to-translate strings, it fails on converting some into UTF-8.

Is there any way to identify which file is to blame? (PoEdit doesn't show its name)

 

Samy RABIH

------------------------------------------------------------------------------
_______________________________________________
Poedit-users mailing list
Poedit-users@...
https://lists.sourceforge.net/lists/listinfo/poedit-users
Vaclav Slavik | 2 Jan 2009 12:24
Gravatar

Re: [poedit-users] Find which file is not UTF-8 convertable

On Fri, 2009-01-02 at 11:45 +0100, Samy RABIH wrote:
> I'm a long time user of PoEdit (for Zenphoto.org project) and
> sometimes we got the following problem : when PoEdit updates his
> to-translate strings, it fails on converting some into UTF-8.

Please read http://www.poedit.net/trac/wiki/HowtoReportBugs -- if you
can't describe the problem precisely, I cannot help you, because I a)
don't understand when and how it happens and b) cannot reproduce it
myself.

> Is there any way to identify which file is to blame?

I'll answer that once you provide details about what exactly it is that
is going on. All I can say for now is that I didn't ever see this error
in any context where it wouldn't be clear what file it relates to.

Regards,
Vaclav
------------------------------------------------------------------------------
_______________________________________________
Poedit-users mailing list
Poedit-users@...
https://lists.sourceforge.net/lists/listinfo/poedit-users
Samy RABIH | 2 Jan 2009 17:28
Picon
Favicon
Gravatar

Re: [poedit-users] Find which file is not UTF-8 convertable

It is not a bug, it's just PoEdit doesn't offer the functionality to say
which file is not convertible into UTF-8 (it could say such things when you
update your .po file from your project source files), so we need to try with
each file.

I've created a ticket : http://www.poedit.net/trac/ticket/285 

-----Message d'origine-----
De : Vaclav Slavik [mailto:vslavik@...] 
Envoyé : vendredi 2 janvier 2009 12:24
À : poedit-users@...
Objet : Re: [poedit-users] Find which file is not UTF-8 convertable

On Fri, 2009-01-02 at 11:45 +0100, Samy RABIH wrote:
> I'm a long time user of PoEdit (for Zenphoto.org project) and 
> sometimes we got the following problem : when PoEdit updates his 
> to-translate strings, it fails on converting some into UTF-8.

Please read http://www.poedit.net/trac/wiki/HowtoReportBugs -- if you can't
describe the problem precisely, I cannot help you, because I a) don't
understand when and how it happens and b) cannot reproduce it myself.

> Is there any way to identify which file is to blame?

I'll answer that once you provide details about what exactly it is that is
going on. All I can say for now is that I didn't ever see this error in any
context where it wouldn't be clear what file it relates to.

Regards,
Vaclav

------------------------------------------------------------------------------
Johannes Mario Ringheim | 14 Jan 2009 13:55
Picon
Favicon

[poedit-users] Problems with special characters

I'm translating a webpage to norwegian which contains special 
characters. Everything seems to be fine in poedit, but when the webpage 
is displayed in that language special characters are broken.

Inspecting the .mo file with gedit, I find for example that "å" has 
turned into "Ã¥", and any other special character scrambled likewise. 
However, in poedit they all display fine.

I've checked that charset is set to utf-8, and the sourcefiles are also 
utf-8. I've also tried to set encoding to iso-8859-1, which makes the 
characters in the .mo files correct, but then I get other problems upon 
displaying the webpage. In short it had been best to use utf-8.

Any ideas as to where I might begin researching this problem? The 
problem probably is in poedit, right? More info needed to debug this 
problem?

Thanks in advance for any ideas or suggestions.

OS: Mandriva 2009.0, also had the same problem with poedit running in WINE.
VERSION: 1.4.2

--

-- 
Ringheims Auto - Fri musikk for bilstereo!
http://ringheimsauto.org

------------------------------------------------------------------------------
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
Poedit-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/poedit-users
Olivier Sannier | 14 Jan 2009 14:20
Picon
Favicon
Gravatar

Re: [poedit-users] Problems with special characters

Have you set your webpage settings to indicate it is encoded in UTF-8 ?
If not, the characters coming from the .mo file will not be interpreted 
as UTF-8 and you will get the weird display.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
Johannes Mario Ringheim | 14 Jan 2009 14:56
Picon
Favicon

Re: [poedit-users] Problems with special characters

Olivier Sannier skreiv:
> Have you set your webpage settings to indicate it is encoded in UTF-8 ?
> If not, the characters coming from the .mo file will not be interpreted 
> as UTF-8 and you will get the weird display.

Yep, it's utf-8:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Furthermore this would not explain why the special characters get 
scrambled in the .po file. If I edit the .po in gedit, and try reopening 
it in poedit, I get this:
"Failed to convert file [filename] to Unicode."

Also, I of course meant "the .po file" when I wrote this:
"Inspecting the .mo file with gedit, I find for example that "å" has
turned into "Ã¥", and any other special character scrambled likewise. "

Thanks for any further input..

-johannes.

--

-- 
Ringheims Auto - Fri musikk for bilstereo!
http://ringheimsauto.org

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
Vaclav Slavik | 14 Jan 2009 15:01
Gravatar

Re: [poedit-users] Problems with special characters

On Wed, 2009-01-14 at 13:55 +0100, Johannes Mario Ringheim wrote:
> I'm translating a webpage to norwegian which contains special 
> characters. Everything seems to be fine in poedit, but when the webpage 
> is displayed in that language special characters are broken.
> 
> Inspecting the .mo file with gedit, I find for example that "å" has 
> turned into "Ã¥", and any other special character scrambled likewise. 

They're not "scrambled", they are encoded using UTF-8 -- which as you
admit below is exactly what you asked Poedit to do.

> However, in poedit they all display fine.

Yet you somehow concluded the problem is in Poedit, even though the only
misbehaving program is your web app.

> I've checked that charset is set to utf-8, and the sourcefiles are also 
> utf-8. I've also tried to set encoding to iso-8859-1, which makes the 
> characters in the .mo files correct,

No, it doesn't make them "correct", it makes them encoded using a
different encoding. You do understand what an encoding is, right?
Because encodings apparently matter to your web app, so it's kind of
important to understand them and not, say, try (and as I suspect, mix)
different encodings at random.

> Any ideas as to where I might begin researching this problem? 

In the web app you're having problems with. 

> The problem probably is in poedit, right? 

No, it almost certainly is not. 

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
Poedit-users@...
https://lists.sourceforge.net/lists/listinfo/poedit-users
Johannes Mario Ringheim | 14 Jan 2009 16:52
Picon
Favicon

Re: [poedit-users] Problems with special characters

Vaclav Slavik skreiv:
>> Inspecting the .mo file with gedit, I find for example that "å" has 
>> turned into "Ã¥", and any other special character scrambled likewise. 
> 
> They're not "scrambled", they are encoded using UTF-8 -- which as you
> admit below is exactly what you asked Poedit to do.

First and foremost I of course meant "Inspecting the .po file", not .mo.

Second, any other utf-8 textfile displays special characters like "å" 
correctly in gedit (meaning "å" as "å", not "Ã¥"). When I write an "å" 
in poedit I expect it to be "å" in the utf-8 encoded po file. It 
appearently is not, so I get the idea that something is wrong.

> No, it doesn't make them "correct", it makes them encoded using a
> different encoding. You do understand what an encoding is, right?
> Because encodings apparently matter to your web app, so it's kind of
> important to understand them and not, say, try (and as I suspect, mix)
> different encodings at random.

I've used utf-8 on the website, as mentioned in my reply to Olivier. 
Otherwise the site works fine and displays special characters correctly.

Now, I tried to do the same process in Ubuntu 8.04 which resides on my 
other machine. I opened the po-file, did some minor edits and saved, and 
guess what? Gedit now displays special characters in po-file correctly. 
But guess again: Is the website displaying it correctly? Nope. This 
strengthens your theory that the problem is on my site. I will 
investigate this further, now that the poedit anomaly is sorted out 
(well, kinda, anyway).

I'm not quite sure what to think of this, if someone does please cry out ;)

--

-- 
Ringheims Auto - Fri musikk for bilstereo!
http://ringheimsauto.org

------------------------------------------------------------------------------
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
Poedit-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/poedit-users
Johannes Mario Ringheim | 14 Jan 2009 17:02
Picon
Favicon

Re: [poedit-users] Problems with special characters

Yet another point to add:

The website displays special characters coming from the translation 
(.mo) incorrectly, but other special characters display fine.

--

-- 
Ringheims Auto - Fri musikk for bilstereo!
http://ringheimsauto.org

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
Olivier Sannier | 14 Jan 2009 17:04
Picon
Favicon
Gravatar

Re: [poedit-users] Problems with special characters

Johannes Mario Ringheim wrote:
> Vaclav Slavik skreiv:
>   
>>> Inspecting the .mo file with gedit, I find for example that "å" has 
>>> turned into "Ã¥", and any other special character scrambled likewise. 
>>>       
>> They're not "scrambled", they are encoded using UTF-8 -- which as you
>> admit below is exactly what you asked Poedit to do.
>>     
>
> First and foremost I of course meant "Inspecting the .po file", not .mo.
>
> Second, any other utf-8 textfile displays special characters like "å" 
> correctly in gedit (meaning "å" as "å", not "Ã¥"). When I write an "å" 
> in poedit I expect it to be "å" in the utf-8 encoded po file. It 
> appearently is not, so I get the idea that something is wrong.
>   
You should use a binary editor to see the bytes that are in the file.
Some editors use the BOM at the start of the file to see if it is UTF-8 
or not. And maybe poedit does not add one, or maybe it does and it 
confuses the text editor, but all in all, it's a display issue that you 
can sort out by using a binary editor.
> I've used utf-8 on the website, as mentioned in my reply to Olivier. 
> Otherwise the site works fine and displays special characters correctly.
>   
Maybe you are double encoding the UTF-8 stream, or double decoding, who 
knows, but it's most likely on your site that the problem resides.

------------------------------------------------------------------------------
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
Poedit-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/poedit-users

Gmane