Re: [dabo-users] Reenv: Problem in Dabo demo

Author: Nick Raptis

Posted: 2011-05-22 at 17:54:37

On 05/22/2011 08:03 PM, melkarth0 wrote:

> Hello, Ed, Hraban and Nick.

>

> I've found a nice way to solve the "dabo demo problem" with my

> "latin-1"="iso8859-1" character set, without changing a single line of the

> dabo framework.

>

> Simply create a file " sitecustomize.py" under Lib\site-packages in my

> python directory:

>

> # sitecustomize.py

> # this file can be anywhere in your Python path,

> # but it usually goes in ${pythondir}/lib/site-packages/

> import sys

> sys.setdefaultencoding('iso8859-1')

>

> This method "set the current default string encoding used by the Unicode

> implementation" (Python library reference).

>

> Before I made this 'discovery', I've tested Nick's proposal :

>

> cd, ch = evt.keyCode, unicode(evt.keyChar, dabo.getEncoding())

>

> . . . and :

>

> File "C:\Projects\dabo\demo\samples/dTextBox.py", line 55, in

> onTextKeyChar

> def onTextKeyChar(self, evt):

> AttributeError: 'module' object has no attribute 'getEncoding'

>

Hehe, strange because it's in dabo's __init__.py and surely:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)

[GCC 4.4.3] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import dabo

>>> dabo.getEncoding()

'UTF8'

>>>

Whatever, I'm glad you sorted this out. Will keep your workaround in mind ;)

> It seems that my dabo has no getEncoding() method.

>

> The solution Ed gave me : to put 'settings_override.py' file in demo

> folder, with line : defaultEncoding = "latin-1" did not work (no error, but

> no different results).

>

> Ok, now I'm done with the demo. It goes OK.

>

> So I begin exploring the Dabo AppWizard and I've generated the CRUD/File

> Management form. When I go to see the grid of customers (the Browse tab):

> lots of wrong characters in the name and address columns!

> Then, I've entered a new record and -Eureka, it's ok! -The new record is

> exactly as I've entered. So, the other records already entered in the online

> database were input by other users with other encodings. PHEW! Big relief.

>

> melkarth

>

_______________________________________________

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/4DD9861D.7060101@otenet.gr

©2011 Nick Raptis