Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Unicode names with DOSLFN driver (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 17.09.2011, 14:41

> Is here any way how to get (with DOSLFN) LFN name of file without
> conversion from UTF-8 to local code page?

Minor nitpick: LFNs are stored in UCS-2 (or maybe UTF-16, not sure, I don't think so though). Of course, if an interface allowed you to access the names with UTF-8 encoded names, that would work too.

> F.e. I have a mix of mp3 files, some with czech names but same with russian
> names and in DOS I am not able to copy them together without destrying
> eighter czech or russian names.

There's no interface that would allow this. You'll have to extend DOSLFN to make it work.

A simple hack to make it work would be to add recognition of a "UTF-8 codepage" to DOSLFN. For that, you'd select some unused codepage number, and if DOSLFN detected that one to be selected, you'd make it convert file names from and to UTF-8 instead of the normal codepage-style conversion. (You could then manually switch to that codepage or whatever.) Besides incompatibility with other programs that don't know this "codepage", the only issue that I can think of right now would be that you'd have to watch out not to overflow the filename buffers; the UTF-8 encoding of non-ASCII characters requires more space than a normal codepage encoding. This should allow you to copy the files without filename corruption. (Lacking UTF-8-capable display drivers, the non-ASCII names would of course show up incorrectly if displayed using DIR or such.)

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22758 Postings in 2121 Threads, 402 registered users (2 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum