461 |
(append codings |
(append codings |
462 |
(char-table-extra-slot char-coding-system-table 0)))))) |
(char-table-extra-slot char-coding-system-table 0)))))) |
463 |
|
|
464 |
|
;; Fixme: is this doing the right thing now, at least with eight-bit? |
465 |
(defun find-multibyte-characters (from to &optional maxcount excludes) |
(defun find-multibyte-characters (from to &optional maxcount excludes) |
466 |
"Find multibyte characters in the region specified by FROM and TO. |
"Find multibyte characters in the region specified by FROM and TO. |
467 |
If FROM is a string, find multibyte characters in the string. |
If FROM is a string, find multibyte characters in the string. |
472 |
COUNT is a number of characters, |
COUNT is a number of characters, |
473 |
CHARs are found characters of the character set. |
CHARs are found characters of the character set. |
474 |
Optional 3rd arg MAXCOUNT limits how many CHARs are put in the above list. |
Optional 3rd arg MAXCOUNT limits how many CHARs are put in the above list. |
475 |
Optional 4th arg EXCLUDE is a list of character sets to be ignored. |
Optional 4th arg EXCLUDE is a list of character sets to be ignored." |
|
|
|
|
For invalid characters, CHARs are actually strings." |
|
476 |
(let ((chars nil) |
(let ((chars nil) |
477 |
charset char) |
charset char) |
478 |
(if (stringp from) |
(if (stringp from) |
480 |
(while (setq idx (string-match "[^\000-\177]" from idx)) |
(while (setq idx (string-match "[^\000-\177]" from idx)) |
481 |
(setq char (aref from idx) |
(setq char (aref from idx) |
482 |
charset (char-charset char)) |
charset (char-charset char)) |
483 |
(if (eq charset 'unknown) |
(if (or (memq charset '(eight-bit-control eight-bit-graphic)) |
|
(setq char (match-string 0))) |
|
|
(if (or (memq charset '(unknown |
|
|
eight-bit-control eight-bit-graphic)) |
|
484 |
(not (or (eq excludes t) (memq charset excludes)))) |
(not (or (eq excludes t) (memq charset excludes)))) |
485 |
(let ((slot (assq charset chars))) |
(let ((slot (assq charset chars))) |
486 |
(if slot |
(if slot |
496 |
(while (re-search-forward "[^\000-\177]" to t) |
(while (re-search-forward "[^\000-\177]" to t) |
497 |
(setq char (preceding-char) |
(setq char (preceding-char) |
498 |
charset (char-charset char)) |
charset (char-charset char)) |
499 |
(if (eq charset 'unknown) |
(if (or (memq charset '(eight-bit-control eight-bit-graphic)) |
|
(setq char (match-string 0))) |
|
|
(if (or (memq charset '(unknown eight-bit-control eight-bit-graphic)) |
|
500 |
(not (or (eq excludes t) (memq charset excludes)))) |
(not (or (eq excludes t) (memq charset excludes)))) |
501 |
(let ((slot (assq charset chars))) |
(let ((slot (assq charset chars))) |
502 |
(if slot |
(if slot |
1635 |
; ay Aymara |
; ay Aymara |
1636 |
; az Azerbaijani |
; az Azerbaijani |
1637 |
; ba Bashkir |
; ba Bashkir |
1638 |
("be" . "Belarussian") ; Belarussian [Byelorussian] |
("be" . "Belarusian") ; Belarusian [Byelorussian until early 1990s] |
1639 |
("bg" . "Bulgarian") ; Bulgarian |
("bg" . "Bulgarian") ; Bulgarian |
1640 |
; bh Bihari |
; bh Bihari |
1641 |
; bi Bislama |
; bi Bislama |
1642 |
; bn Bengali, Bangla |
; bn Bengali, Bangla |
1643 |
("bo" . "Tibetan") |
("bo" . "Tibetan") |
1644 |
("br" . "Latin-1") ; Breton |
("br" . "Latin-1") ; Breton |
1645 |
|
("bs" . "Latin-2") ; Bosnian |
1646 |
("ca" . "Latin-1") ; Catalan |
("ca" . "Latin-1") ; Catalan |
1647 |
; co Corsican |
; co Corsican |
1648 |
("cs" . "Czech") |
("cs" . "Czech") |
1649 |
("cy" . "Latin-8") ; Welsh |
("cy" . "Welsh") ; Welsh |
1650 |
("da" . "Latin-1") ; Danish |
("da" . "Latin-1") ; Danish |
1651 |
("de" . "German") |
("de" . "German") |
1652 |
; dz Bhutani |
; dz Bhutani |
1657 |
("es" . "Spanish") |
("es" . "Spanish") |
1658 |
("et" . "Latin-4") ; Estonian |
("et" . "Latin-4") ; Estonian |
1659 |
("eu" . "Latin-1") ; Basque |
("eu" . "Latin-1") ; Basque |
1660 |
; fa Persian |
; fa Persian glibc uses utf-8 |
1661 |
("fi" . "Latin-1") ; Finnish |
("fi" . "Latin-1") ; Finnish |
1662 |
; fj Fiji |
; fj Fiji |
1663 |
("fo" . "Latin-1") ; Faroese |
("fo" . "Latin-1") ; Faroese |
1668 |
("gl" . "Latin-1") ; Galician |
("gl" . "Latin-1") ; Galician |
1669 |
; gn Guarani |
; gn Guarani |
1670 |
; gu Gujarati |
; gu Gujarati |
1671 |
("gv" . "Latin-8") ; Manx Gaelic |
("gv" . "Latin-8") ; Manx Gaelic glibc uses 8859-1 |
1672 |
; ha Hausa |
; ha Hausa |
1673 |
("he" . "Hebrew") |
("he" . "Hebrew") |
1674 |
("hi" . "Devanagari") ; Hindi glibc uses utf-8 |
("hi" . "Devanagari") ; Hindi glibc uses utf-8 |
1702 |
("lv" . "Latvian") ; Latvian, Lettish |
("lv" . "Latvian") ; Latvian, Lettish |
1703 |
; mg Malagasy |
; mg Malagasy |
1704 |
("mi" . "Latin-7") ; Maori |
("mi" . "Latin-7") ; Maori |
1705 |
("mk" . "Latin-5") ; Macedonian |
("mk" . "Cyrillic-ISO") ; Macedonian |
1706 |
; ml Malayalam |
; ml Malayalam |
1707 |
; mn Mongolian |
; mn Mongolian |
1708 |
; mo Moldavian |
; mo Moldavian |
1725 |
("rm" . "Latin-1") ; Rhaeto-Romanic |
("rm" . "Latin-1") ; Rhaeto-Romanic |
1726 |
; rn Kirundi |
; rn Kirundi |
1727 |
("ro" . "Romanian") |
("ro" . "Romanian") |
1728 |
("ru.*[_.]koi8" . "Cyrillic-KOI8") ; Russian |
("ru.*[_.]koi8\\(?:-r\\)?\\'" . "Cyrillic-KOI8") ; Russian |
1729 |
("ru" . "Latin-5") ; Russian |
("ru" . "Cyrillic-ISO") ; Russian |
1730 |
; rw Kinyarwanda |
; rw Kinyarwanda |
1731 |
("sa" . "Devanagari") ; Sanskrit |
("sa" . "Devanagari") ; Sanskrit |
1732 |
; sd Sindhi |
; sd Sindhi |
1741 |
; so Somali |
; so Somali |
1742 |
("sq" . "Latin-1") ; Albanian |
("sq" . "Latin-1") ; Albanian |
1743 |
("sr" . "Latin-2") ; Serbian (Latin alphabet) |
("sr" . "Latin-2") ; Serbian (Latin alphabet) |
1744 |
|
("sr.*@cyrillic" . "Cyrillic-ISO") ; per glibc |
1745 |
; ss Siswati |
; ss Siswati |
1746 |
; st Sesotho |
; st Sesotho |
1747 |
; su Sundanese |
; su Sundanese |
1749 |
("sw" . "Latin-1") ; Swahili |
("sw" . "Latin-1") ; Swahili |
1750 |
; ta Tamil glibc uses utf-8 |
; ta Tamil glibc uses utf-8 |
1751 |
; te Telugu glibc uses utf-8 |
; te Telugu glibc uses utf-8 |
1752 |
("tg" . "Cyrillic-KOI8-T") ; Tajik |
("tg" . "Tajik") |
1753 |
("th" . "Thai") |
("th" . "Thai") |
1754 |
; ti Tigrinya |
; ti Tigrinya |
1755 |
; tk Turkmen |
; tk Turkmen |
1766 |
("uz" . "Latin-1") ; Uzbek |
("uz" . "Latin-1") ; Uzbek |
1767 |
("vi" . "Vietnamese") ; glibc uses utf-8 |
("vi" . "Vietnamese") ; glibc uses utf-8 |
1768 |
; vo Volapuk |
; vo Volapuk |
1769 |
|
("wa" . "Latin-1") ; Walloon |
1770 |
; wo Wolof |
; wo Wolof |
1771 |
; xh Xhosa |
; xh Xhosa |
1772 |
("yi" . "Windows-1255") ; Yiddish |
("yi" . "Windows-1255") ; Yiddish |
1775 |
|
|
1776 |
; glibc: |
; glibc: |
1777 |
; zh_CN.GB18030/GB18030 \ |
; zh_CN.GB18030/GB18030 \ |
|
; zh_CN.GBK/GBK \ |
|
1778 |
; zh_HK/BIG5-HKSCS \ |
; zh_HK/BIG5-HKSCS \ |
|
; zh_TW/BIG5 \ |
|
|
; zh_TW.EUC-TW/EUC-TW \ |
|
1779 |
|
|
1780 |
("zh.*[._]big5" . "Chinese-BIG5") |
("zh.*[._]big5" . "Chinese-BIG5") |
1781 |
("zh.*[._]gbk" . nil) ; Solaris 2.7; has gbk-0 as well as GB 2312.1980-0 |
("zh.*[._].gbk" . "Chinese-GBK") |
1782 |
|
;; glibc has zh_TW.EUC-TW, with zh_TW defaulting to Big5 |
1783 |
("zh_tw" . "Chinese-CNS") |
("zh_tw" . "Chinese-CNS") |
1784 |
("zh" . "Chinese-GB") |
("zh" . "Chinese-GB") |
1785 |
; zu Zulu |
; zu Zulu |
1796 |
("cz" . "Czech") ; e.g. Solaris 2.6 |
("cz" . "Czech") ; e.g. Solaris 2.6 |
1797 |
("ee" . "Latin-4") ; Estonian, e.g. X11R6.4 |
("ee" . "Latin-4") ; Estonian, e.g. X11R6.4 |
1798 |
("iw" . "Hebrew") ; e.g. X11R6.4 |
("iw" . "Hebrew") ; e.g. X11R6.4 |
1799 |
("sp" . "Latin-5") ; Serbian (Cyrillic alphabet), e.g. X11R6.4 |
("sp" . "Cyrillic-ISO") ; Serbian (Cyrillic alphabet), e.g. X11R6.4 |
1800 |
("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6 |
("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6 |
1801 |
("jp" . "Japanese") ; e.g. MS Windows |
("jp" . "Japanese") ; e.g. MS Windows |
1802 |
("chs" . "Chinese-GB") ; MS Windows Chinese Simplified |
("chs" . "Chinese-GB") ; MS Windows Chinese Simplified |
1816 |
(".*8859[-_]?9\\>" . "Latin-5") |
(".*8859[-_]?9\\>" . "Latin-5") |
1817 |
(".*8859[-_]?14\\>" . "Latin-8") |
(".*8859[-_]?14\\>" . "Latin-8") |
1818 |
(".*8859[-_]?15\\>" . "Latin-9") |
(".*8859[-_]?15\\>" . "Latin-9") |
1819 |
(".*@euro\\>" . "Latin-9") |
(".*utf\\(-?8\\)\\>" . "UTF-8") |
1820 |
(".*utf\\(-?8\\)\\>" . "UTF-8"))) |
(".*@euro\\>" . "Latin-9"))) ; utf-8@euro exists, so put this last |
1821 |
"List of pairs of locale regexps and charset language names. |
"List of pairs of locale regexps and charset language names. |
1822 |
The first element whose locale regexp matches the start of a downcased locale |
The first element whose locale regexp matches the start of a downcased locale |
1823 |
specifies the language name whose charsets corresponds to that locale. |
specifies the language name whose charsets corresponds to that locale. |