Thread: [Boa Constr] Encoding on Ubuntu
Status: Beta
Brought to you by:
riaan
From: Werner F. B. <wer...@fr...> - 2007-09-25 10:32:35
|
Me again, Do I have to do some special steps moving Python source from my Windows box to Ubuntu? I am asking as I get encoding errors when I try to run my application from within Boa, it complains that 'utf-8' can't decode: self.MainMenu.SetLabel(wxID_TWCBFPRINTINGLABELVINOTETAGS, _('Vinoté printable tags')) If I copy/paste this string into the shell and print the variable it shows correctly. Werner |
From: <ia...@gm...> - 2007-09-25 15:12:56
|
SSBoYXZlIGZvdW5kIHRoZXJlIGFyZSBwcm9ibGVtcywgbm90IGp1c3QgaW4gbGludXgsIHdpdGgg aGF2aW5nCm5vbi1hc2NpaSBjaGFyYWN0ZXJzIGVuY29kZWQgaW4gdXRmLTggYXMgdHJhbnNsYXRp b24gc3RyaW5ncy4gSW4gbXkKY2FzZSBJIHVzZWQgYWxsIGFzY2lpIGFuZCB1c2VkIGdldHRleHQg dG8gYWRkIGFueSBhY2NlbnRzLiBCdXQgdGhlbgphZ2FpbiBJIHdhcyBhbHJlYWR5IHVzaW5nIGl0 IGZvciB0cmFuc2xhdGlvbnMuCgpBbnl3YXksIGFzIGZhciBhcyB5b3VyIHByb2JsZW0sIHlvdSBk byBoYXZlIHRoZSBlbmNvZGluZyBzZXQgYXQgdGhlCnRvcCBvZiB5b3VyIGZpbGUgY29ycmVjdD8K Ckhvd2V2ZXIsIHRoZXJlIGFyZSBwcm9ibGVtcyB3aXRoIGJvYSBpbiBsaW51eCB3aXRoIHV0Zi04 LiBTb21ldGltZXMgaXQKd2lsbCBjb21wbGFpbiBhYm91dCBlcnJvciBtZXNzYWdlcyBvciBwcmlu dCBzdGF0ZW1lbnRzLiBUaGUgc2FtZSBjb2RlCnJ1biBmcm9tIGNvbW1hbmQgbGluZSBpcyBmaW5l LCBhcyBpcyB0aGUgc2FtZSBjb2RlIGluIHdpbmRvd3MuIE5ldmVyCmhhZCB0aGUgY2hhbmNlIHRv IGludmVzdGlnYXRlIGZ1cnRoZXIgLi4uIHNvcnJ5CgoyMDA3LzkvMjUsIFdlcm5lciBGLiBCcnVo aW4gPHdlcm5lci5icnVoaW5AZnJlZS5mcj46Cj4gTWUgYWdhaW4sCj4KPiBEbyBJIGhhdmUgdG8g ZG8gc29tZSBzcGVjaWFsIHN0ZXBzIG1vdmluZyBQeXRob24gc291cmNlIGZyb20gbXkgV2luZG93 cwo+IGJveCB0byBVYnVudHU/Cj4KPiBJIGFtIGFza2luZyBhcyBJIGdldCBlbmNvZGluZyBlcnJv cnMgd2hlbiBJIHRyeSB0byBydW4gbXkgYXBwbGljYXRpb24KPiBmcm9tIHdpdGhpbiBCb2EsIGl0 IGNvbXBsYWlucyB0aGF0ICd1dGYtOCcgY2FuJ3QgZGVjb2RlOgo+ICAgICAgICAgc2VsZi5NYWlu TWVudS5TZXRMYWJlbCh3eElEX1RXQ0JGUFJJTlRJTkdMQUJFTFZJTk9URVRBR1MsCj4gXygnVmlu b3TDqSBwcmludGFibGUgdGFncycpKQo+Cj4gSWYgSSBjb3B5L3Bhc3RlIHRoaXMgc3RyaW5nIGlu dG8gdGhlIHNoZWxsIGFuZCBwcmludCB0aGUgdmFyaWFibGUgaXQKPiBzaG93cyBjb3JyZWN0bHku Cj4KPiBXZXJuZXIKCi0tIAotIGlhbmFyw6kgc8OpdmkKTGUgSG9tYXJkIGRlIFZpbmNpCg== |
From: Werner F. B. <wer...@fr...> - 2007-09-25 16:08:45
|
Hi, ianaré sévi wrote: > I have found there are problems, not just in linux, with having > non-ascii characters encoded in utf-8 as translation strings. In my > case I used all ascii and used gettext to add any accents. But then > again I was already using it for translations. I worked around the problem by just removing the offending characters and using gettext to get the correct thing. > > Anyway, as far as your problem, you do have the encoding set at the > top of your file correct? Yeap. > > However, there are problems with boa in linux with utf-8. Sometimes it > will complain about error messages or print statements. The same code > run from command line is fine, as is the same code in windows. Good to know. Finding all kind of other little (and bigger things). - I call maximize on the frame and it works on windows but not gtk2 - some of the sizers don't seem to work under gkt2, at least they don't work the same way then under windows (but you know about this one already). - I am loading dummy notebook pages initially and then when user clicks on them I load the real one. This is done to optimize/speed up initial loading. On gtk2 this crashes, seen something about no event being fired when deleting a nb page - will have to look into this. Will have to setup cvs server before going much further as otherwise I will end up with two versions instead of one which works on both :(. Werner - Never > had the chance to investigate further ... sorry > > 2007/9/25, Werner F. Bruhin <wer...@fr...>: >> Me again, >> >> Do I have to do some special steps moving Python source from my Windows >> box to Ubuntu? >> >> I am asking as I get encoding errors when I try to run my application >> from within Boa, it complains that 'utf-8' can't decode: >> self.MainMenu.SetLabel(wxID_TWCBFPRINTINGLABELVINOTETAGS, >> _('Vinoté printable tags')) >> >> If I copy/paste this string into the shell and print the variable it >> shows correctly. >> >> Werner > |
From: Oleg D. <thi...@td...> - 2007-09-28 09:55:32
|
Hello, Werner F. Bruhin said the following on 25.09.2007 13:31: > I am asking as I get encoding errors when I try to run my application > from within Boa, it complains that 'utf-8' can't decode: > self.MainMenu.SetLabel(wxID_TWCBFPRINTINGLABELVINOTETAGS, > _('Vinoté printable tags')) Have you tried to replace it with this: _(u'Vinoté printable tags') ? -- Oleg |
From: Werner F. B. <wer...@fr...> - 2007-09-28 11:08:30
|
Hi Oleg, Oleg Deribas wrote: > Hello, > > Werner F. Bruhin said the following on 25.09.2007 13:31: > >> I am asking as I get encoding errors when I try to run my application >> from within Boa, it complains that 'utf-8' can't decode: >> self.MainMenu.SetLabel(wxID_TWCBFPRINTINGLABELVINOTETAGS, >> _('Vinoté printable tags')) > > Have you tried to replace it with this: > > _(u'Vinoté printable tags') I think I did. Currently working on some other stuff, will check this again. Thanks Werner |
From: Werner F. B. <wer...@fr...> - 2007-09-28 15:29:22
|
Hi Oleg, Oleg Deribas wrote: > Hello, > > Werner F. Bruhin said the following on 25.09.2007 13:31: > >> I am asking as I get encoding errors when I try to run my application >> from within Boa, it complains that 'utf-8' can't decode: >> self.MainMenu.SetLabel(wxID_TWCBFPRINTINGLABELVINOTETAGS, >> _('Vinoté printable tags')) > > Have you tried to replace it with this: > > _(u'Vinoté printable tags') Yeap, that fixes it. Anyone having a script out there to change all (for a file and/or folder) the "_('" to "_(u'" and one should probably also change all the # -*- coding: iso-8859-1 -*-# to # -*- coding: utf-8 -*-# and probably also all the normal (non gettext) strings too. Werner |