Attached is a patch that makes SIDE properly open and save UTF-8 encoded Unicode files. I was able to load and save the sample text from the other thread.
Terminal needs some work to display Unicode properly. Right now it's processing input 1 byte at a time. Due to the escape handling, it will need to be UTF-8 aware, which doesn't look like a big problem. I'll work on this tomorrow.
My openFileName change is a little different. The saveFile change was identical.
Pros or cons? Seems like we don't need to use QByteArray for this approach.
QTextStream in(&file);
+ in.setCodec("UTF-8");
data = in.readAll();
If you look at the terminal that frees me up to do other things.
I'll push my current console.cpp change which is a little more manageable.
Let me know if you need anything.
Send your gmail account on PM and I'll add you to contributors.
If that works, great! I was working from the approach that UTF-8 is 8bit and all of the handlers needed to be 8-bit clean. However, if Qt has "smart" UTF-8 handling, as long as that works, I don't see any reason not to use that.
Comments
My openFileName change is a little different. The saveFile change was identical.
Pros or cons? Seems like we don't need to use QByteArray for this approach.
If you look at the terminal that frees me up to do other things.
I'll push my current console.cpp change which is a little more manageable.
Let me know if you need anything.
Send your gmail account on PM and I'll add you to contributors.
Thanks!
--Steve