Re: [Modeling-users] working in unicode?
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-04-20 12:58:22
|
Hi, Mario Ruggier <ma...@ru...> wrote: > i would like to be able to write and read unicode (as transparently as > possible) to a text attribute. Postgres/PyPgSQL supports this (see the > 'Databases' section in http://dalchemy.com/opensource/unicodedoc/ > -- an article I found very useful). However I have no idea about mysql. >=20 > It seems that modeling operates in latin-1? Is this true? > Can I work around this in any way, or configure the framework to > assume utf-8 as encoding? The problem with latin-1 is that it > is not a unicode encoding, so even if most of the special characters > I would need to handle now are latin-1, sooner than later there will > be problems. latin-1? No, I never assumed a particular encoding for strings. It can be that the framework does not behave correctly because of the unicode type, but if this happens this is definitely a bug, it was not intended. Two kinds of problems may arise: 1. the underlying adaptor itself (musqldb,psycopg, etc.) do not handle uncide strings very well --I've no idea how adapters handle this, never tried it, 2. mdl assumes that the strings' type is string, not unicode, and some operations fail. I never tried unicode strings, hence I do not have more to say on that. Maybe you could go ahead and try it, and then report? -- S=E9bastien. PS: Oh, maybe you thought latin-1 because of the 'latin-1' in the model? That one in the model only specifies how the xml file is produced, and it has nothing to do with the framework runtime. |