Code::Blocks (C::B) had a long known problem of crashing / locking up while an accented character is used in the code. Or even worse when the encoding of a file is changed from one encoding to another. It was able to support upto UTF-8 encoding with occasional lock-up.
I started working on this around 2-3 months back. But during testing we found that C::B still hangs and it is due to Code-Completion (CC) plugin. The issue was due to the presence of some ANSI functions in Code-Completion parser. Morten then started his work to fix this. It almost resulted to a small re-write of Code-Completion. And we could finally test our Unicode changes with CC enabled.
We tested it for couple of weeks before we found it to be stable enough for further real-life testing by our users. In revision 4548, the first collection of patches were committed (including Morten’s patch on CC). Few users posted some issues which were then quickly resolved. As of writing, the code seems to be quite stable.
So what are the changes that have been made??
There were a number of changes that has been made.
- Encoding detection code has been improved by using a portion of MadEdit’s encoding detection code. Currently it can detect, UTF-8, UTF-16 BE/LE, UTF-32 BE/LE with/without BOM. The fall back code has been kept to ANSI (CP-1252 on Windows).
- Encoding conversion routine has been overhauled. Now it converts back and forth all supported encodings flawlessly.
- Now all the encoding detection and conversion code is much more efficient as it involves minimum disk reads and most of the operation is done in memory buffers (Thanks Thomas for keeping this strict criteria).
- The file load routine has been moved from a all in one load-plus-encoding detection code to efficiently distributed code.
- File save routine was overhauled to save files with all supported encodings.
- Project load routine has been tweaked to reduce the stalling while opening a large project with a large number of open files in it.
- Morten made CC parser Unicode compliant so that it can now parse any files without a single lock-up.
I would request users to use Build Revision 4553 onwards to get the most benefit out of it. Please post any related issues in the forum itself.