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

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


Hi,

On maanantai 14 heinäkuu 2014, Max Böhm wrote:
> 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);
> 
> see https://gist.github.com/1052abb7c6d542f16037
> 
> 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:
> https://gist.github.com/a8b0ba0aa6d3bc8adab5

Regarding this part of your patch:
* ommented out because this is risky. When deleting files which
* contain invalid characters, the inserted wildcard '?' may match
* also on other files, and an arbitrary file may be deleted.

What kind of use-case you had in mind?

The file you get on emulated Atari and select to be deleted,
should be the same that gets deleted.  Tools that use wildcards
for this kind of things are typically under MiNT, and that
bypasses GEMDOS emulation.


> 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.


	- Eero



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