Author: melkarth0
Posted: 2011-05-21 at 03:02:58
Finally, it seems that I'm bound to 'latin-1' encoding.
I changed line 56 in dTextBox.py, in onTextKeyChar() section in the demo:
cd, ch = evt.keyCode, evt.keyChar
for this one:
cd, ch = evt.keyCode, unicode(evt.keyChar, 'latin-1')
and now runs fine and logit() displays a beautiful a-acute.
More, unicode(evt.keyChar, 'utf-8') doesn't work.
But, please, if anybody has a better approach, make me know it. I have a
conceptual confusion with this encodings stuff. For example, if I put the
line # -*- coding: latin-1 -*- on all the affected demo modules, will it
works as is?
Greetings
Melkarth
-----Original Message-----
From: dabo-users-bounces@leafe.com [mailto:dabo-users-bounces@leafe.com] On
Behalf Of Henning Hraban Ramm
Sent: viernes, 20 de mayo de 2011 11:01
To: Dabo list Users
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo
Am 2011-05-20 um 09:06 schrieb melkarth0:
> Ok, thank you, Hraban. I've already checked that dTextBox works fine
> outside the dabo demo; I'm worried about it no more. I'll try to play
> with your solution, but my priority now is to keep learning Dabo.
But since you're learning Python as you go, it might be a good example to
keep attention to Python's quirks like ASCII vs. Unicode "strings".
Greetlings from Lake Constance!
Hraban
---
https://www.cacert.org (I'm an assurer)
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/143638ED-FEF9-4CFD-A5AF-2331E95C7533@fiee.ne
t
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/000501cc1785$1ec64020$5c52c060$@gmail.com