我有一些一段代碼:CLISP:集編碼爲UTF-8字符串
; Palatal Pulmonic Consonants
(loop for e in (list
'(:nasal "ɲ")
'(:plosive "c") '(:plosive "ɟ")
'(:fricative "ç") '(:fricative "ʝ")
'(:approximant "j")
'(:lateral-fricative "ʎ̥˔")
'(:lateral-approximant "ʎ")
'(:lateral-flap "ʎ̯")) do
(add-sound :palatal (car e) (cadr e)))
我有很多這些位爲所有IPA符號,這沒有特別的問題之一。
但是,試圖運行我的代碼給出了這樣的錯誤:
SYSTEM::STRING-READER: Invalid byte #x90 in CHARSET:CP1252 conversion
這很好,但我不能找到一個辦法,在腳本文件,告訴我在UTF-8中輸入字符串CLISP ,我希望它能夠讀取並以UTF-8格式打印出來。
如何在全局範圍內永久設置UTF-8。我在類似地考慮Ruby的# encoding: utf-8
特別是我使用CLisp 2.48。
編輯:
下面是完整的源文件列表導致問題:
(defstruct sound place means sym)
(defparameter $sounds nil)
(defun add-sound (place means sym)
(setf $sounds (append $sounds (list (make-sound :place place :means means :sym sym)))))
; There are alot of IPA symbols, so we'll add them column by column.
; The first column is the Bilabial Pulmonic Consonants
(loop for e in (list
'(:nasal "m") '(:plosive "p")
'(:plosive "b") '(:fricative "ɸ")
'(:fricative "β") '(:trill "ʙ")
'(:flap "ⱱ̟")) do
(add-sound :bilabial (car e) (cadr e)))
; Labiodental Pulmonic Consonants
(loop for e in (list
'(:nasal "ɱ") '(:plosive "p̪")
'(:plosive "b̪") '(:fricative "f")
'(:fricative "v") '(:approximant "ʋ")
'(:flap "ⱱ")) do
(add-sound :labiodental (car e) (cadr e)))
; Dental Pulmonic Consonants
(loop for e in (list
'(:nasal "n̪")
'(:plosive "t̪") '(:plosive "d̪")
'(:fricative "θ") '(:fricative "ð")) do
(add-sound :dental (car e) (cadr e)))
; Alveolar Pulmonic Consonants
(loop for e in (list
'(:nasal "n")
'(:plosive "t") '(:plosive "d")
'(:fricative "s") '(:fricative "z")
'(:trill "r")
'(:flap "ɾ")
'(:lateral-fricative "ɬ") '(:lateral-fricative "ɮ")
'(:lateral-approximant "l")
'(:lateral-flap "ɺ")) do
(add-sound :alveolar (car e) (cadr e)))
; Palato-Alveolar Pulmonic Consonants
(loop for e in (list
'(:fricative "ʃ") '(:fricative "ʒ")
'(:approximant "ɹ")) do
(add-sound :palato-alveolar (car e) (cadr e)))
; Retroflex Pulmonic Consonants
(loop for e in (list
'(:nasal "ɳ")
'(:plosive "ʈ") '(:plosive "ɖ")
'(:fricative "ʂ") '(:fricative "ʐ")
'(:approximant "ɻ")
'(:trill "ɽ͡r")
'(:flap "ɽ")
'(:lateral-fricative "ɭ˔̊")
'(:lateral-approximant "ɭ")
'(:lateral-flap "ɺ̢")) do
(add-sound :retroflex (car e) (cadr e)))
; Palatal Pulmonic Consonants
(loop for e in (list
'(:nasal "ɲ")
'(:plosive "c") '(:plosive "ɟ")
'(:fricative "ç") '(:fricative "ʝ")
'(:approximant "j")
'(:lateral-fricative "ʎ̥˔")
'(:lateral-approximant "ʎ")
'(:lateral-flap "ʎ̯")) do
(add-sound :palatal (car e) (cadr e)))
; Velar Pulmonic Consonants
(loop for e in (list
'(:nasal "ŋ")
'(:plosive "k") '(:plosive "ɡ")
'(:fricative "x") '(:fricative "ɣ")
'(:approximant "ɰ")
'(:lateral-fricative "ʟ̝̊")
'(:lateral-approximant "ʟ")) do
(add-sound :velar (car e) (cadr e)))
; Uvular Pulmonic Consonants
(loop for e in (list
'(:nasal "ɴ")
'(:plosive "q") '(:plosive "ɢ")
'(:fricative "χ") '(:fricative "ʁ")
'(:trill "ʀ")
'(:flap "ɢ̆")) do
(add-sound :uvular (car e) (cadr e)))
; Pharyngeal Pulmonic Consonants
(loop for e in (list
'(:plosive "ʡ")
'(:fricative "ħ") '(:fricative "ʕ")
'(:trill "ʜ") '(:trill "ʢ")
'(:flap "ʡ̯")) do
(add-sound :pharyngeal (car e) (cadr e)))
; Glottal Pulmonic Consonants
(loop for e in (list
'(:plosive "ʔ")
'(:fricative "h") '(:fricative "ɦ")) do
(add-sound :glottal (car e) (cadr e)))
你究竟做了什麼來獲得錯誤? – sds
我運行clisp.exe /path/to/file.lisp,其中該文件包含上述示例。我可以發佈更多的文件,但這並不是相關的。 –
好,你可以在「clisp.exe」和「/ path/to/file.lisp」之間插入「-E UTF-8」來獲得clisp.exe -E UTF-8/path /到/ file.lisp'「? – sds