Re: [hatari-devel] Character conversion for filenames in GEMDOS HD emulation

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


2014-07-14 16:09 GMT+02:00 Max Böhm <mboehm3@xxxxxxxxx>:
Hello developers,

The GEMDOS HD emulation is really cool and works very well. But currently,
if filenames contain special characters like 'ä', 'ö', 'ü', 'ß', they
are mapped to '@' on the host system and the characters are lost (this
happens for all codes above 128 of the AtariST character set) .

I have written support functions, which convert strings between the AtariST
character set and the Linux (utf-8) and Windows (cp1252) character sets.

extern void Str_AtariToUtf8(const char *source, char *dest);
extern void Str_Utf8ToAtari(const char *source, char *dest, char replacementChar);
extern void Str_AtariToWindows(const char *source, char *dest, char replacementChar);
extern void Str_WindowsToAtari(const char *source, char *dest, char replacementChar);


All characters which exist in the target code are mapped correctly. If a 
character does not exist the replacementChar is inserted.

Here is a patch which integrates these functions into Hatari:

With this patch GEMDOS HD emulation will support all characters which
can be represented on the host system. The patch can be applied by:

patch -p1 --fuzz=3 <../hatari-1.7.0.gemdos.patch

It would be nice if someone who knows the gemdos.c and str.c code well,
could have a look and check if the integration has been done correctly.
Would also be nice if this can be integrated into of the Hatari sources.

Max


Nice idea. Could you add support for user to setup encoding on runtime?

--
Semper Fidelis

Adam Klobukowski
adamklobukowski@xxxxxxxxx


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/