<p>If you plan to use international characters in your batchfiles you are wise to read about <em>file
encodings</em> below.</p>
<sectionid="a-note-on-file-encodings">
<h2>A note on File Encodings<aclass="headerlink"href="#a-note-on-file-encodings"title="Permalink to this headline">¶</a></h2>
<p>As mentioned, both the processors take text files as input and then proceed to process them. As long
as you stick to the standard <aclass="reference external"href="https://en.wikipedia.org/wiki/Ascii">ASCII</a> character set (which means
the normal English characters, basically) you should not have to worry much about this section.</p>
<p>Many languages however use characters outside the simple <codeclass="docutils literal notranslate"><spanclass="pre">ASCII</span></code> table. Common examples are various
apostrophes and umlauts but also completely different symbols like those of the greek or cyrillic
alphabets.</p>
<p>First, we should make it clear that Evennia itself handles international characters just fine. It
<p>The problem is that when reading a text file like the batchfile, we need to know how to decode the
byte-data stored therein to universal unicode. That means we need an <em>encoding</em> (a mapping) for how
the file stores its data. There are many, many byte-encodings used around the world, with opaque
names such as <codeclass="docutils literal notranslate"><spanclass="pre">Latin-1</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">ISO-8859-3</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">ARMSCII-8</span></code> to pick just a few examples. Problem is that
it’s practially impossible to determine which encoding was used to save a file just by looking at it
(it’s just a bunch of bytes!). You have to <em>know</em>.</p>
<p>With this little introduction it should be clear that Evennia can’t guess but has to <em>assume</em> an
encoding when trying to load a batchfile. The text editor and Evennia must speak the same “language”
so to speak. Evennia will by default first try the international <codeclass="docutils literal notranslate"><spanclass="pre">UTF-8</span></code> encoding, but you can have
Evennia try any sequence of different encodings by customizing the <codeclass="docutils literal notranslate"><spanclass="pre">ENCODINGS</span></code> list in your settings
file. Evennia will use the first encoding in the list that do not raise any errors. Only if none
work will the server give up and return an error message.</p>
<p>You can often change the text editor encoding (this depends on your editor though), otherwise you
need to add the editor’s encoding to Evennia’s <codeclass="docutils literal notranslate"><spanclass="pre">ENCODINGS</span></code> list. If you are unsure, write a test
file with lots of non-ASCII letters in the editor of your choice, then import to make sure it works
as it should.</p>
<p>More help with encodings can be found in the entry <aclass="reference internal"href="../Concepts/Text-Encodings.html"><spanclass="doc std std-doc">Text Encodings</span></a> and also in the
Wikipedia article <aclass="reference external"href="https://en.wikipedia.org/wiki/Text_encodings">here</a>.</p>
<p><strong>A footnote for the batch-code processor</strong>: Just because <em>Evennia</em> can parse your file and your
fancy special characters, doesn’t mean that <em>Python</em> allows their use. Python syntax only allows
international characters inside <em>strings</em>. In all other source code only <codeclass="docutils literal notranslate"><spanclass="pre">ASCII</span></code> set characters are