title: CLisp: set encoding to UTF-8 for strings
body: <p>I have some piece of code:</p>
  
  <pre><code>; 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)))
  </code></pre>
  
  <p>I have a lot of these bits for all IPA symbols, this isn't specifically the problem one.</p>
  
  <p>However, attempting to run my code gives this error:</p>
  
  <blockquote>
    <p>SYSTEM::STRING-READER: Invalid byte #x90 in CHARSET:CP1252 conversion</p>
  </blockquote>
  
  <p>Which is fine, except I cannot find a way to, WITHIN the script file, tell CLisp that I am typing strings in UTF-8, and I want it to read them and print them in UTF-8.</p>
  
  <p>How do I globally, permanently set UTF-8. I am thinking similarly to Ruby's <code># encoding: utf-8</code></p>
  
  <p>Specifically I am using CLisp 2.48.</p>
  
  <p>EDIT:</p>
  
  <p>Here is the full source listing for the file that causes the issue:</p>
  
  <pre><code>(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)))
  </code></pre>