Perfect! Thanks Evert. I realise now that I don't fully grasp the concepts of encoding and collation and their relationship.
-- Emmanuel On Wed, Oct 6, 2010 at 10:38 PM, Evert Rol <evert....@gmail.com> wrote: > > > > >>> print customerName > > ImmobiliŠre (whatever) > > >>> customerName > > 'Immobili\x8are (whatever)' > > > > There should be a small E with a grave accent (è) instead of the capital > S with a caron (Š) I'm getting. > > > > I've tried applying various encodings, but to no avail: > > > <snip /> > > > When executed from MS SQL Server's Management Studio, the same query > returns "Immobilière (whatever)", with an 'è', as it should. > > > > The field in question is of type nvarchar, with collation > SQL_Latin1_General_CP850_CI_AS. > > Well, you're SQL server seems to use CP850, which is (almost) the first > encoding I tried: > > >>> name= 'Immobili\x8are' > >>> name > 'Immobili\x8are' > >>> print name.decode('cp850') > Immobilière > >>> > > Seems to work for me. > > Evert > > > >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor