Full UTF-8 support in XML-layout files

4 views
Skip to first unread message

yomoma

unread,
May 28, 2009, 6:30:18 AM5/28/09
to QxTransformer
Hello,

thank you for a great tool, it helps me alot! but then i try to set
labels or content of the items in UTF-8, i get this (from Mako-
generated template, i think):

__M_writer(unicode(attr.constructorList()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position
1-4: ordinal not in range(128)

the source is:

<qx:label content="Цена:" alignX="right"/>

i can override each label from code, but this is too costly. so, how
can i set content in UTF-8? is this a bug in qxtransformer or i' am
doing something wrong?

ps. sorry for my bad english =)

yomoma

unread,
May 28, 2009, 6:28:31 AM5/28/09
to QxTransformer

Siarhei Barysiuk

unread,
May 28, 2009, 7:35:22 AM5/28/09
to qxtran...@googlegroups.com
Hi,

Thanks for reporting this. I'll take a look today. You don't need to
override each label content from javascript, hopefully I'll be able to
fix this.
Will let you know here about the progress soon.

Thanks,
Siarhei

P.S. BTW, I noticed russian in your label content. ;) I'm from Belarus.

Siarhei Barysiuk

unread,
May 28, 2009, 11:01:15 AM5/28/09
to qxtran...@googlegroups.com
Okay, I fixed this. Please update your local copy from our repository.
Are you using the latest trunk version or 0.4a? If 0.4a, you can add
these lines right after imports section in bin/qxtransformer.py:

import...
.....

reload(sys)
sys.setdefaultencoding( "utf-8" )


Thanks for reporting this issue.

Cheers,
Siarhei




On May 28, 2009, at 1:28 PM, yomoma wrote:

>

Siarhei Barysiuk

unread,
May 28, 2009, 12:59:52 PM5/28/09
to qxtran...@googlegroups.com
Okay, as I learnt from docs, it's a bit hacky to use sys.setdefaultencoding.
Let's leave as is for now until I fix this in normal way.

S.


2009/5/28 Siarhei Barysiuk <s.bar...@gmail.com>:

yomoma

unread,
Jun 1, 2009, 4:40:53 AM6/1/09
to QxTransformer
Thank you for the "sys.setdefaultencoding" solution, it's good enough
for me right now. Looking forward for the next qxt transformer
version! =)

Ilya.


On May 28, 8:59 pm, Siarhei Barysiuk <s.barys...@gmail.com> wrote:
> Okay, as I learnt from docs, it's a bit hacky to use sys.setdefaultencoding.
> Let's leave as is for now until I fix this in normal way.
>
> S.
>
> 2009/5/28 Siarhei Barysiuk <s.barys...@gmail.com>:
>
>
>
> > Okay, I fixed this. Please update your local copy from our repository.
> > Are you using the latest trunk version or 0.4a? If 0.4a, you can add these
> > lines right after imports section in bin/qxtransformer.py:
>
> > import...
> > .....
>
> > reload(sys)
> > sys.setdefaultencoding( "utf-8" )
>
> > Thanks for reporting this issue.
>
> > Cheers,
> > Siarhei
>
> > On May 28, 2009, at 1:28 PM, yomoma wrote:
>
> >> Hello,
>
> >> thank you for a great tool, it helps me alot! but then i try to set
> >> labels or content of the items in UTF-8, i get this (from Mako-
> >> generated template, i think):
>
> >>   __M_writer(unicode(attr.constructorList()))
> >> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> >> 1-4: ordinal not in range(128)
>
> >> the source is:
>
> >> <qx:label content="Цена:" alignX="right"/>
>
> >> i can override each label from code, but this is too costly. so, how
> >> can i set content in UTF-8? is this a bug in qxtransformer or i' am
> >> doing something wrong?
>
> >> ps. sorry for my bad english =)- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages