Python utf8 encoding problem?

Simple. You're assuming that it's UTF-8 print 'She\x92s Out of My League'. Decode('cp1252') She’s Out of My League.

Simple. You're assuming that it's UTF-8. >>> print 'She\x92s Out of My League'.

Decode('cp1252') She’s Out of My League.

I'm dealing with filenames here. Filenames both on Windows and Unix. – Shrihari May 24 at 19:01 2 CP1252 will work with CP1252-encoded text.

– Ignacio Vazquez-Abrams May 24 at 19:02 Ya, I get that. I want something to work with all the characters allowed in a filename. Which one do I choose?

– Shrihari May 24 at 19:03 3 There isn't any one encoding you can use, unless you force the encoding input into your software. Have fun! – Ignacio Vazquez-Abrams May 24 at 19:06 sys.

Getfilesystemencoding() returns a guess about the filesystem encoding of the current system, and all path functions (e.g. Os.path. Join, os. Listdir) would return unicode (using this guessed encoding) if you give them unicode arguments.

Also if you're using cp1252 on a Unix system, you might consider switching to utf8 to avoid bigger issues. – Rosh Oxymoron May 24 at 20:09.

I'm working on a Python application and having some problems handling strings. There is this string "She’s Out of My League" (without quotes). I stored it in a variable and tried to insert it into an sqlite3 database.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions