Thread [Tk] File auswählen unicode (31 answers)
Opened by welle at 2013-11-01 20:07

Raubtier
 2013-11-06 21:05
#171871 #171871
User since
2012-05-04
1054 Artikel
BenutzerIn

user image
2013-11-06T12:48:41 GUIfreund
2013-11-05T19:27:13 Raubtier
Quote
It's the user's responsibility to determine the encoding of the underlying filesystem and convert the result into bytes, e.g.

Code (perl): (dl )
1
2
3
4
5
           use Encode;
           ...
           my $dir = $mw->chooseDirectory;
           $dir = encode("windows-1252", $dir);
           opendir DIR, $dir or die $!;
Es ist also normal, dass man konvertieren muss.

Interpretierst du das so, dass man für Windows anders kodieren muss als für Linux? Für NTFS anders als für FAT, für ext3 anders als für ext2? Das kann ich nicht glauben. Mein XP-Programm lief jedenfalls auch auf Linux. Zugegeben, damals hatte ich das Problem mit den Umlauten noch nicht bemerkt und daher kein encode eingebaut.


Leider noch nicht einmal "für Windows", sondern eben für das Dateisystem! NTFS ist Unicode, aber FAT? Da hängt das Charset von der Sprache des Windows ab! Siehe hier: http://msdn.microsoft.com/en-us/library/windows/de...

Daher kannst du auch, wenn du unter Linux eine (V)FAT-Partition mountest, ein charset mit angeben. Standard ist eben die Engliche CP437.

View full thread [Tk] File auswählen unicode