[Solved] Not UTF8 format

souvarine

15-08-2009 18:17:48

Hello everyone.

I have been playing with MyGUI (2.2.2) for a week now and I love it. But I have a problem when I try to edit the languages files. If I modify a language file, or create a new one, MyGUI give me an error in the logs saying
file 'core_language_english.txt' is not UTF8 format | MyGUI_LanguageManager.cpp | 147

It works as long as I use the core_language_english.txt provided with MyGUI sources, but as soon as I modify it I get this error. I've tried several text editors, all configured to produce UTF8 output of course, but without success.

I'm probably missing something very simple here but I can't figure out what it is :oops:
Thanks for your help.

Altren

15-08-2009 19:39:15

Please upload any file you made that gives you that error.

souvarine

15-08-2009 19:51:53

Here is one
http://aliasrobotique.org/~souvarine/core_language_french.txt

my.name

16-08-2009 12:19:40

To open with notepad
Save as UTF8 format

souvarine

16-08-2009 14:22:40

I don't have Windows, therefor no notepad.
But I think I understand what's is going wrong now. When opening an UTF8 file, MyGUI looks for the Byte Order Mark (BOM) and if it doesn't find it it give an error message saying that the file is no valid UTF8. Actually, use of BOM isn't mandatory with UTF8 and it isn't recommended on Unix.

So I just have to find a text editor that use UTF8 with BOM.

Thanks for your help.


A simple script did the trick

#!/bin/bash
shopt -s xpg_echo
if [ $# != 2 ]
then
echo "Usage : addbom infile outfile"
else
(echo '\xEF\xBB\xBF\c' & cat $1) > $2
fi