Re: Locale Encoding & Filenames

David Huang <khym-+fkPqM/[email protected]>
Newsgroups gmane.comp.multimedia.dvdauthor.user
Message-ID <[email protected]>
On Apr 9, 2010, at 6:18 AM, Lawrence D'Oliveiro wrote:

>> On Fri, 2010-04-09 at 19:36 +1200, Lawrence D'Oliveiro wrote:
>>> 
>>> Previously, filenames would be treated as encoded according to your 
>>> locale settings. Now, the behaviour is to treat them as always being in 
>>> UTF-8 encoding, unless you build with the --enable-localize-filenames 
>>> configure option.
> 

Which filenames are we talking about? Filenames specified in the XML file, filenames specified on the commandline, or both? Filenames specified on the commandline should be assumed to use the current locale encoding. Filenames in the XML should be assumed to be the XML file's encoding (which, if not specified, is UTF-8).

> For those who have been working the old way for too long, and think it’s 
> too difficult to change, this is why convmv was developed.

What if someone doesn't feel any need to change? I understand that EUC-JP is still very popular in Japan. You want someone to rename their files to be compatible with dvdauthor, and incompatible with all the other applications they use?

>> The same is true on Windows unless you use Windows-specific
>> functions that take wide strings.
> 
> Not likely, since NTFS has been using Unicode as its underlying encoding 
> for names since about 1993.


Sure, *NTFS* uses Unicode, but the Windows API has two versions of every function that takes a string: the "ANSI" version, which uses the system's locale setting, and the "Wide" version, which uses UTF-16 (not UTF-8). I believe Windows dvdauthor binaries are usually built with mingw32, which I'm not too familiar with, but I get the impression that as with MS Visual C++, the standard library functions, such as open(), take strings encoded with the system's locale. If you want the wchar_t UTF-16 versions, you need to use the "_w*" set of functions, e.g., _wopen().

Have you actually tried your change under Windows?
-- 
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym-+fkPqM/[email protected] |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 34 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.