Re: i18n and unicode

Gregor Horvath <gh-LfrpOBifzZo+ytmZ3SK/[email protected]>
Newsgroups gmane.comp.python.formencode
Organization Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung
Message-ID <[email protected]>
Ian Bicking schrieb:

> Andrea Arcangeli brought up a problem in private email about the recent 
> i18n code.  Specifically, it causes previously-str error messages to be 
> returned as unicode.  Since these are error messages (i.e., text) I 

One solution could be in clients code to do: (untested)

import formencode

def _(s):
  return s

formencode.api._stdtrans = _


> I don't have any good ideas on resolutions here, except perhaps to just 
> put in a big warning.

I think text processing should always be unicode, so the problem is not
with formencode.
Currently for the fallback the standard ugettext function is used, which
always returns unicodes.

We could add a attribute

api.no_gettext

and bypass the whole translation at all if this flag is set.

But again I think the correct solution would be to correct the client
code to work with unicode.

--
Gregor


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.