Skip to content
Snippets Groups Projects
Commit 1edf58ce authored by Jakob Moser's avatar Jakob Moser
Browse files

Try supporting utf-8

parent 6089ff29
No related tags found
1 merge request!1Draft: Support UTF-8
......@@ -59,6 +59,18 @@ sudo docker container run xle $(cat data.json | base64 -w0)
The idea to implement it that way came from [Christian Heusel](https://christian.heusel.eu/), thank you very much!
</details>
## :abcd: A word about encoding
By default, this container lets XLE use its default encoding, whatever that is (not UTF-8). If you want to use UTF-8, you have to add the following line to your grammar file in the `CONFIG` section
```
CHARACTERENCODING utf-8.
```
**and** execute `set-character-encoding stdio utf-8` every time after starting XLE.
`xle-docker` will automatically use `utf-8` as character encoding for standard input if it detects the character encoding configuration line (more precisely, a line matching `^\s*CHARACTERENCODING\s+utf-8\s*\..*$` anywhere in the file).
## :page_with_curl: About
Here, a more detailed explanation of the relevant files is given. The used sources are marked with :books:.
......
......@@ -15,8 +15,12 @@ else
SENTENCE=$1
fi
export LC_ALL="C.utf8"
# Write xlerc containing instructions to parse
echo "create-parser /grammar.lfg" > xlerc
# Check if we are using utf-8
#(grep -E '^\s*CHARACTERENCODING\s+utf-8\s*\..*$' /grammar.lfg > /dev/null) && echo "set-character-encoding stdio utf-8" >> xlerc
echo "packed-xml-fs { $SENTENCE } packed-parses.xml" >> xlerc
echo "exit" >> xlerc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment