UnicodeDecodeError

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

UnicodeDecodeError

Stefan Björk
> > I'm running on a machine where I have no root privileges. I have tried
> > to install the latest SVN version of Gramps in my home directory
> > (--prefix=$HOME), but there seem to be problem with a couple of
> > things, such as GConf and scrollkeeper.
>
> Yes, this is expected, unless non-default options for those
> are specified.

Thank you, I managed to compile and install Gramps, both the head SVN
version and the older CVS version. However, I still experience an error:

/home/s/skalman/share/gramps/gramps.py:101: PangoWarning: Invalid UTF-8 string passed to pango_layout_set_text()
  gtk.main()
Traceback (most recent call last):
    File "/home/s/skalman/share/gramps/StartupDialog.py", line 206, in complete
    GrampsKeys.save_researcher_name(unicode(self.name.get_text()))
    UnicodeDecodeError: 'utf8' codec can't decode bytes in position 9-12: invalid data

Could this have something to do with the fact that I run an Xvnc
server in en_US.iso88591 locale? The error occurs with both
LANG=sv_SE.utf8 and LANG=sv_SE.iso88591 and no LANG at all.

Stefan

--
Stefan Björk, student                http://www.acc.umu.se/~skalman/
Umeå Universitet                                      +46-70-6222437


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: UnicodeDecodeError

Alex Roitman
Stefan,

On Wed, 2006-04-05 at 08:03 +0200, Stefan Björk wrote:

> Thank you, I managed to compile and install Gramps, both the head SVN
> version and the older CVS version. However, I still experience an error:
>
> /home/s/skalman/share/gramps/gramps.py:101: PangoWarning: Invalid UTF-8 string passed to pango_layout_set_text()
>   gtk.main()
> Traceback (most recent call last):
>     File "/home/s/skalman/share/gramps/StartupDialog.py", line 206, in complete
>     GrampsKeys.save_researcher_name(unicode(self.name.get_text()))
>     UnicodeDecodeError: 'utf8' codec can't decode bytes in position 9-12: invalid data
>
> Could this have something to do with the fact that I run an Xvnc
> server in en_US.iso88591 locale? The error occurs with both
> LANG=sv_SE.utf8 and LANG=sv_SE.iso88591 and no LANG at all.
This looks like a problem encoding your name, as it has
the "ö" character in it. My guess is that it is stored as latin1
and then attempted to interpret as utf8. I am not sure how exactly
this happened.

As a workaround, you may enter something ascii-only or UTF-8
into the gconf key storing the researcher name. The key is
called /apps/gramps/researcher/researcher-name
You may either use command line (gconftool-2) or GUI (gconf-editor)
to get/set the key.

Please let me know if this solves the problem,
Alex

--
Alexander Roitman   http://www.gramps-project.org

signature.asc (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: UnicodeDecodeError

Stefan Björk
Alex,

> This looks like a problem encoding your name, as it has
> the "ö" character in it. My guess is that it is stored as latin1
> and then attempted to interpret as utf8. I am not sure how exactly
> this happened.
>
> As a workaround, you may enter something ascii-only or UTF-8
> into the gconf key storing the researcher name. The key is
> called /apps/gramps/researcher/researcher-name
> You may either use command line (gconftool-2) or GUI (gconf-editor)
> to get/set the key.

Your guess was right. My name was taken from the /etc/passwd file, which
had my name in Latin-1 coding. This scenario is probably rare, but there
could be a good idea to include a utf8 validation of strings imported
from system files.

Editing the name in the dialogue was rather tricky (press "End", then a
couple of "Backspace", but you can't see what you're doing). I never had
to use the gconf tools.

I'll see if I can get the swedish translation up to date now.

Stefan



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: UnicodeDecodeError

Alex Roitman
Stefan,

On Thu, 2006-04-06 at 08:08 +0200, Stefan Björk wrote:
> Your guess was right. My name was taken from the /etc/passwd file, which
> had my name in Latin-1 coding. This scenario is probably rare, but there
> could be a good idea to include a utf8 validation of strings imported
> from system files.

Good idea, I'll look at that.

> Editing the name in the dialogue was rather tricky (press "End", then a
> couple of "Backspace", but you can't see what you're doing). I never had
> to use the gconf tools.

You lost me here: which dialog are we talking about? Were you trying to
do it in gconf-editor? You should see what's in there as well as any
of your input. If there's nothing then just enter your name.

You should also be able to use the Gramps' preference dialog in 2.0.x
version. In 2.2.x version we have yet to bring it back from the dead.

> I'll see if I can get the swedish translation up to date now.

Beware that 2.2.x is far from being stable. Chances are that many
strings will have changed between now and 2.2.0 release. Nothing
wrong with translating strings now, but I don't want you to do
extra work without being aware of it :-)

Alex

--
Alexander Roitman   http://www.gramps-project.org

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: UnicodeDecodeError

Stefan Björk-2
Alex,

>>Editing the name in the dialogue was rather tricky (press "End", then a
>>couple of "Backspace", but you can't see what you're doing). I never had
>>to use the gconf tools.
>
> You lost me here:

No problem. It wasn't important at all, but if you are curious, I'll
give it another try:

When Gramps started, I did get the welcome dialogue where I was supposed
to fill in my researcher information. My name was already there, taken
from the /etc/passwd file, but it only said "Stefan Bj" since
GTK/Gnome/Glade/whatever could not parse the latin-1 string as an utf-8
string. However, the rest of my name ("örk", that is, which
coincidentally is a swedish word that express that what you eat tastes
like... well, bad) was there in the dialogue, although not shown. Just
marking "Stefan Bj" and typing something else, still left the trailing,
hidden "örk" untouched. So I had to go to the end of the string, by
pressing "End", which meant that the entire field went blank. After four
backspaces, I had deleted the "ö" character and everything showed up again.

Now, this is a very long explanation for something quite uninteresting
and completely unimportant, but since English is not my native language,
I couldn't come up with a better explanation.

Well. Anyway.

> Beware that 2.2.x is far from being stable.

You bet. Looks great, but bangs on you when you try to do something. :-)

I will update 2.0.x in the meantime.

Stefan


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel