vietnamese.el 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
  2. ;; Copyright (C) 1998, 2001-2012 Free Software Foundation, Inc.
  3. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  4. ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
  5. ;; National Institute of Advanced Industrial Science and Technology (AIST)
  6. ;; Registration Number H14PRO021
  7. ;; Copyright (C) 2003
  8. ;; National Institute of Advanced Industrial Science and Technology (AIST)
  9. ;; Registration Number H13PRO009
  10. ;; Keywords: multilingual, Vietnamese, i18n
  11. ;; This file is part of GNU Emacs.
  12. ;; GNU Emacs is free software: you can redistribute it and/or modify
  13. ;; it under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation, either version 3 of the License, or
  15. ;; (at your option) any later version.
  16. ;; GNU Emacs is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;; GNU General Public License for more details.
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  22. ;;; Commentary:
  23. ;; For Vietnamese, the character sets VISCII, VSCII and TCVN-5712 are
  24. ;; supported.
  25. ;;; Code:
  26. (define-coding-system 'vietnamese-viscii
  27. "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)."
  28. :coding-type 'charset
  29. :mnemonic ?V
  30. :charset-list '(viscii)
  31. :mime-charset 'viscii
  32. :suitable-for-file-name t)
  33. (define-coding-system-alias 'viscii 'vietnamese-viscii)
  34. (define-coding-system 'vietnamese-vscii
  35. "8-bit encoding for Vietnamese VSCII-1."
  36. :coding-type 'charset
  37. :mnemonic ?v
  38. :charset-list '(vscii)
  39. :suitable-for-file-name t)
  40. (define-coding-system-alias 'vscii 'vietnamese-vscii)
  41. ;; (make-coding-system
  42. ;; 'vietnamese-vps 4 ?p
  43. ;; "8-bit encoding for Vietnamese VPS"
  44. ;; '(ccl-decode-vps . ccl-encode-vps)
  45. ;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
  46. ;; (valid-codes (0 . 255))))
  47. ;;
  48. ;; (define-coding-system-alias 'vps 'vietnamese-vps)
  49. (define-coding-system 'vietnamese-viqr
  50. "Vietnamese latin transcription (VIQR)."
  51. :coding-type 'utf-8
  52. :mnemonic ?q
  53. :charset-list '(ascii viscii)
  54. :post-read-conversion 'viqr-post-read-conversion
  55. :pre-write-conversion 'viqr-pre-write-conversion)
  56. (define-coding-system-alias 'viqr 'vietnamese-viqr)
  57. (set-language-info-alist
  58. "Vietnamese" `((charset viscii)
  59. (coding-system vietnamese-viscii vietnamese-vscii
  60. vietnamese-tcvn vietnamese-viqr windows-1258)
  61. (nonascii-translation . viscii)
  62. (coding-priority vietnamese-viscii)
  63. (input-method . "vietnamese-viqr")
  64. (unibyte-display . vietnamese-viscii)
  65. (features viet-util)
  66. (sample-text . "Vietnamese (Ti,1*(Bng Vi,1.(Bt) Ch,1`(Bo b,1U(Bn")
  67. (documentation . "\
  68. For Vietnamese, Emacs uses special charsets internally.
  69. They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, VIQR
  70. and windows-1258. VSCII is deprecated in favor of TCVN-5712. The
  71. Current setting gives higher priority to the coding system VISCII than
  72. TCVN-5712. If you prefer TCVN-5712, please do: (prefer-coding-system
  73. 'vietnamese-tcvn). There are two Vietnamese input methods: VIQR and
  74. Telex, VIQR is the default setting.")))
  75. (define-coding-system 'windows-1258
  76. "windows-1258 encoding for Vietnamese (MIME: WINDOWS-1258)"
  77. :coding-type 'charset
  78. :mnemonic ?*
  79. :charset-list '(windows-1258)
  80. :mime-charset 'windows-1258)
  81. (define-coding-system-alias 'cp1258 'windows-1258)
  82. (define-coding-system 'vietnamese-tcvn
  83. "8-bit encoding for Vietnamese TCVN-5712"
  84. :coding-type 'charset
  85. :mnemonic ?t
  86. :charset-list '(tcvn-5712)
  87. :suitable-for-file-name t)
  88. (define-coding-system-alias 'tcvn 'vietnamese-tcvn)
  89. (define-coding-system-alias 'tcvn-5712 'vietnamese-tcvn)
  90. (provide 'vietnamese)
  91. ;;; vietnamese.el ends here