Sorry for hijacking this thread, but UnicodeEncodeErrors are quite
common on dabo apps, i'm a portuguese speaker, so i've face them quite
often, i've fixed some of them, however, i think the final solution is
to put:
import sys
if hasattr(sys, "frozen"): #py2exe
sys.setdefaultencoding('utf-8')
else: #The Python interpreter needs to reload the
function
reload(sys)
sys.setdefaultencoding('utf-8')
del sys.setdefaultencoding
in the app main file start.
This will set pythons default encoding to utf8, which will allow a much
broader set of characters to be used.
Tracking all of the places where there are UnicodeEncodeErrors seems
mostly impossible to me, wouldn't this be a better alternative?
AFAIK python 3 already uses utf8 as default to avoid this kind of issues.
Regards,
Pedro Vale de Gato
Dabo Trac escreveu:
> #1203: Non ascii chars in table names
> -------------------------------------------+--------------------------------
> Reporter: raffaele | Owner:
> Type: defect | Status: new
> Priority: minor | Milestone: 0.9.2
> Component: ide | Version: 0.9.1
> Keywords: UnicodeEncodeError tablenames |
> -------------------------------------------+--------------------------------
> If you use the AppWizard to generate an application on top of a PostgreSQL
> database with non-ascii chars in field names (such as 'Quantità '), the
> wizard fails with UnicodeEncodeError: ... ordinal out of range (128)
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.237 / Virus Database: 270.11.3/1967 - Release Date: 02/23/09
> 07:17:00
>
>
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]