I found I can set character encoding to the connection modifying the
file database.py from turbogears:
_engine = sqlalchemy.create_engine(dburi, echo=echo)
changes to
_engine = sqlalchemy.create_engine(dburi, echo=echo,
encoding='latin-1')

Then everything works almost right, since an ñ is written and then
read but looking funny.

Anyway, I assume that modifing the lib sources is not a good idea. Any
advices?


Miguel Saez wrote:
> Please excuse me if this has already been discused.
>
> I'm using SQLAlchemy on a new project under Turbogears. Our database model
> is partly done, since we are actually making a new version of an old
> product. That's the main reason why we've chosen SQLAlchemy, since I read it
> may be more configurable and adaptable than SQLObject.
>
> My problem right now is related to encodings. I'm being able to insert
> unicode values to the database, but not reading. Even though I can insert
> unicode values, it is not being done really properly, as a 'ñ' character is
> being persisted as '+¦'.
>
> When trying to read this values I get an exeption saying:
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 9-10:
> invalid data.
>
> Has anyone been working with SQLAlchemy + MSSQL 2000?
>
> Any adviced will be appreciated.
>
> Thanks!
>
> Miguel
>
> ------=_Part_22682_25280948.1159454179408
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 904
>
> Please excuse me if this has already been discused.<br><br>I'm using 
> SQLAlchemy on a new project under Turbogears. Our database model is partly 
> done, since we are actually making a new version of an old product. That's 
> the main reason why we've chosen SQLAlchemy, since I read it may be more 
> configurable and adaptable than SQLObject.
> <br><br>My problem right now is related to encodings. I'm being able to 
> insert unicode values to the database, but not reading. Even though I can 
> insert unicode values, it is not being done really properly, as a 'ñ' 
> character is being persisted as '+¦'.
> <br><br>When trying to read this values I get an exeption saying: 
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 9-10: invalid 
> data. <br><br>Has anyone been working with SQLAlchemy + MSSQL 
> 2000?<br><br>Any adviced will be appreciated.
> <br><br>Thanks!<br><br>Miguel<br><br>
> 
> ------=_Part_22682_25280948.1159454179408--


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to