Shift JIS decoding error
Closed this issue · 4 comments
Deleted user commented
THTK version: 12
The ECL compiler will generate error messages during processing a Shift JIS character '能' (0x945c in Shift JIS)
Here is the error messages:
st06bs.decl:806,0: unterminated string
st06bs.decl:806,0: syntax error, unexpected end of file
Here are the lines in st06bs.decl:
ins_537(60, 3300, 0, "能");
ins_401(60, 4, 0.0f, 128.0f);
It may be caused by multibyte character decoding.
ManDude commented
Which text editor are you using? Make sure the text files is encoded to shift-jis.
DankRank commented
Workaround: use escape sequences :-)
ManDude commented
Oh wait, 5Ch
is \
, lol...
DankRank commented
There are three ways to fix this
- somehow use mblen to ignore multi-byte sequences in strings
- same as 1, but roll our own mblen that doesn't depend on the libc locale.
- add a special flag to do utf-8 <-> shift-jis conversions after then strings are read
Only the last option makes sense to me.