Hi,
when I create a File using the createAndWriteFile-Method of IFileSystem, i get a file which I can't open with gedit because it says that it can't find out the charset (I'm using Ubuntu 10.10 and the latest Irrlicht release).
Using emacs i can open the file, bit it seems weird: between every letter there is a "^@" which i don't know how it gets there... it almost looks like a binary file or something like that,
Using Windows it worked just fine.
Why does Irrlicht create such weird files? I just want a normal text file that I can open with a normal text editor...
Thank you,
D.
createAndWriteFile creates weird files on Linux
It sounds like you write widechar (wchar_t) strings into the file. Those are 4 bytes on Linux, but despite that most Linux editors don't seem to be able to handle utf-32 (which would be needed).
2 solutions - either don't write wchar_t but convert to char first or convert the file afterward with iconv like:
iconv -f UTF-32 -t UTF-8 yourfile > targetfile
2 solutions - either don't write wchar_t but convert to char first or convert the file afterward with iconv like:
iconv -f UTF-32 -t UTF-8 yourfile > targetfile
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Ah XML... yes, that's a problem. I found no solution for that myself so far and have to use iconv every time on files written by Irrlicht in Linux :-( Which is one of the main reasons I still use tinyXML instead of irrXML whenever I can.
Allowing to write other text-formats with xml is very high on the wishlist and Nalin even has written a utf8-string-class some weeks/months ago and adapted the xml-writer to allow doing that. I had wished to include that in Irrlicht 1.8, but didn't find time the last months due to another time consuming project.
So right now ... use iconv or find any way to work with utf-32 in a Linux editor. People occasionally tell me that they can do that on their Linux system, but so far no one managed to help me to get any editor on my Linux system (debian) really working with utf-32. If you figure it out please tell me.
Allowing to write other text-formats with xml is very high on the wishlist and Nalin even has written a utf8-string-class some weeks/months ago and adapted the xml-writer to allow doing that. I had wished to include that in Irrlicht 1.8, but didn't find time the last months due to another time consuming project.
So right now ... use iconv or find any way to work with utf-32 in a Linux editor. People occasionally tell me that they can do that on their Linux system, but so far no one managed to help me to get any editor on my Linux system (debian) really working with utf-32. If you figure it out please tell me.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
If you really need UTF-8 XML files, here are my Irrlicht patches that CuteAlien alluded to:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=37296
All you will need is the ustring class and the XML reading/writing files and patches. You will need to modify your Irrlicht project file / makefile in order to add CXMLWriterUTF8.cpp to the Irrlicht project.
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=37296
All you will need is the ustring class and the XML reading/writing files and patches. You will need to modify your Irrlicht project file / makefile in order to add CXMLWriterUTF8.cpp to the Irrlicht project.