#1030: Creates files in UTF-8 only
-------------------+--------------------------------------------------------
Reporter: wRAR | Owner: andar
Type: bug | Status: new
Priority: major | Milestone:
Component: other | Version: 1.1.9
Keywords: |
-------------------+--------------------------------------------------------
Changes (by wRAR):
* cc: w...@… (added)
Comment:
File names are stored on the UNIX filesystem as sequences of bytes, using
some encoding. When that encoding is the same as the current locale, file
name is readable. When it is not - usually it is not. Deluge writes
filenames as utf8 strings even when the current locale is not utf8. I
couldn't find code where files are created, but because internal
representation is utf8 string, I can safely assume that these strings are
passed to OS unmodified. If you'll pass an unicode string to open()
builtin or to os.open(), the file will be created using the current locale
encoding automatically. If you'll pass a 8-bit string, the file will be
created with the contents of that string as its name. If that 8-bit string
contains utf8 data, the file name will contain utf8 data. If the locale is
not utf8, that file name will be unreadable.
And when I speak about unicode strings, I mean python built-in 'unicode'
type.
And when I suggest using unicode strings as the only internal
representation of string data, I not only repeat the general convention of
programming using unicode-aware programming languages, I also prepare you
for Py3k, whose strings are the same as 'unicode' data type of python 2.x
and when that convention is actually enforced.
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/1030#comment:2>
Deluge <http://deluge-torrent.org/>
Deluge project
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Deluge Dev" 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/deluge-dev?hl=en
-~----------~----~----~----~------~----~------~--~---