Hi!

Michael Kreuzer wrote:

> dvbcut has problems with filenames containing unicode characters like german 
> umlauts.

It also has problems with ISO-8859-1 (aka Latin-1) style umlauts.

> Attached is a patch which will fix this. The problem is, that when 
> you convert from a QString to a std::string or vice versa you have to 
> encode/decode the string. I hope i have found all locations where to 
> encode/decode the string.

And how does dvbcut know *how* to encode/decode it? Does it look at my
locale settings (e.g. LC_CTYPE) or does it just guess? In either case,
it will be as wrong as the current version.

The problem is that filenames may be UTF-8 encoded or Latin-1 encoded
(or KOI-8 or GB-2312 or ...). Encodings may even be mixed, e.g. when you
mount a FAT32 or NTFS volume on Linux and copy files between them. And a
program can't reliably tell the difference, because all it understands
is raw bytes.

So, in my case (Latin-1 filenames), dvbcut would have to transcode
filenames to UTF-8 when it writes them to the project file. On a typical
Suse desktop system, it must not do that because the filenames are
already UTF-8 encoded (unless you changed the default configuration).

encodeName/decodeName will break the Windows port as well. Quoting from
the Qt docs:

> When you use QFile, QFileInfo, and QDir to access the file system
> with Qt, you can use Unicode file names. On Unix, these file names
> are converted to an 8-bit encoding. If you want to do your own file
> I/O on Unix, you should convert the file name using this function. On
> Windows NT/2000, Unicode file names are supported directly in the
> file system and this function should be avoided. On Windows 95,
> non-Latin1 locales are not supported.

Since Unicode slowly becomes the norm also on Unix/Linux, it's probably
better to not explicitly encode/decode filenames.

-- 
Michael "Tired" Riepe <[EMAIL PROTECTED]>
X-Tired: Each morning I get up I die a little

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
DVBCUT-user mailing list
DVBCUT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to