From: Oleg <ya...@gm...> - 2006-05-26 13:06:08
|
2006/5/26, Oleg <ya...@gm...>: > However if the current encoding is UTF-8, then it's impossible to > define FAT codepage automatically :( > In this case it should be configured manually. Solution exists! We can check $LANG in this case! Here is Beta2: --------------------------- BEGIN ----------------------------- #!/bin/sh export FSTAB_IOCHARSET=3D`locale charmap | tr A-Z a-z` case "$FSTAB_IOCHARSET" in "iso-8859-2" | "cp1250" ) FSTAB_CODEPAGE=3D"852";; # Latin-2 "iso-8859-5" | "cp1251" | "koi8-r" | "koi8-u" | "koi8-t" ) FSTAB_CODEPAGE=3D"866";; # Cyrillic "iso-8859-6" | "cp1250" ) FSTAB_CODEPAGE=3D"864";; # Arabic "iso-8859-7" ) FSTAB_CODEPAGE=3D"737";; # Greek "iso-8859-8" ) FSTAB_CODEPAGE=3D"862";; # Hebrew "iso-8859-9" | "cp1254" ) FSTAB_CODEPAGE=3D"857";; # Turkish "iso-8859-13" | "cp1257" ) FSTAB_CODEPAGE=3D"775";; # Baltic "utf-8" ) case "${LANG:0:2}" in "bs" | "cs" | "hr" | "hu" | "pl" | "ro" | "sk" | "sl" ) FSTAB_CODEPAGE=3D"852";; # Latin-2 "be" | "bg" | "mk" | "ru" | "tg" | "uk" ) FSTAB_CODEPAGE=3D"866";; # Cyrillic "ar" ) FSTAB_CODEPAGE=3D"864";; # Arabic "el" ) FSTAB_CODEPAGE=3D"737";; # Greek "iw" | "he" ) FSTAB_CODEPAGE=3D"862";; # Hebrew "tr" ) FSTAB_CODEPAGE=3D"857";; # Turkish "lt" | "lv" | "mi" ) FSTAB_CODEPAGE=3D"775";; # Baltic *) FSTAB_CODEPAGE=3D"850";; # Latin-1 & Latin-9 esac;; *) FSTAB_CODEPAGE=3D"850";; # Latin-1 & Latin-9 esac export FSTAB_IOCHARSET FSTAB_CODEPAGE echo "iocharset=3D$FSTAB_IOCHARSET,codepage=3D$FSTAB_CODEPAGE" --------------------------- END ---------------------------- I decided to use codepade 850 by default, because I don't see any drawbacks of this decision. Does anybody see them? |