curl-and-python

Uploading files with UTF-8 names

From: Andre Polykanine <andre_at_oire.org>
Date: Sun, 9 Jun 2013 02:01:10 +0300

Hello everyone,
I asked about this issue on StackOverflow:
http://stackoverflow.com/q/16993637/1604592
but I was suggested to write to a mailing list, so I'm asking for your
help.
The thing is that I can't upload a file that has in its name letters
not being in the encoding that is set for non-unicode programs in
Windows.
For example: I have Windows with Russian set as language for
non-unicode programs. That means that everything non-unicode is in
win-1251 by default.
If I don't convert the filename, everything goes flawlessly if the
name contains English and/or Russian letters. However, if there is an
å, for example, CURL throws error 26.
If, however, I convert the filename to UTF-8:
local_filename = filename.encode("utf8")
then error 26 is thrown at me even the filename contains Russian
letters.
Could you help me, please?
Thanks!
  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2013-06-09