User forums > Nightly builds
The 02 February 2009 build (5432) is out.
nanyu:
--- Quote ---You provide an ANSI file with "non-ANSI" characters.
--- End quote ---
The file was created by c::b.
In the prior version (svn 5382) c::b, I have set the "Use encoding when opening files" to "UTF-8", since most of time I need to write the wxWidget (UNICODE ver ) project.
one day, I need to write "Console project" . As you knonwn, the windows OS' console can't show any Chinese character which encoded by utf-8. So, I changed the main.cpp file's encoding from c::b's "Edit" menu. save it, compile... run, everything OK with "svn 5382" version.
Yesterday I updated c::b to svn5432, open the main.cpp, then show nothing.
----------------------------------------
--- Quote ---Choose the right encoding in the first place (when you create the file) I'd say.
--- End quote ---
but when I create a new text file by "notepad", and input some Chinese character (or any other non-ANSI character) ...and try to "Save-as", the notepad give me four options:
ANSI
Unicode
Unicode big endian
UTF-8
I understand it maybe not the right encoding , but I have to select the "ANSI".
I know I can just save the file to UTF-8, and write some code to convert the encoding before output to console:
std::cout << convert_utf8_to_gb2312 ("~~chinese char~~") << std::endl;
But doing this will cost me an arm and a leg... I am writing a book for c++ beginner how to program with code::blocks. And the first program is write "Hello world!" but in Chinese. How can I to explain the "convert_utf8_to_gb2312" ? Long long ago, I study C++ by Turbo C++, It can output the Chinese version "Hello world" just like Code::Blocks all versions before "svn 5342"
BTW, the ThreadSearch plugin couldn't work for the same file, I gust it was the same reason.
:( sorry for my broken English again..
nanyu:
I roll back the c::b to prior version: svn 5382, and open the main.cpp again.I found c::b (5382) can detect the file's encoding is "Windows 936" (yes, it is 'code page' for gb2312).
Then, I update the c::b to svn 5432 again. and Set the "Encoding" to "WINDOWS 936" and "As fallback encoding". And I open the main.cpp again. I found the status bar show "utf8". and editor show nothing yet .
svn 5432: see also : ).
svn 5382 : see the attach.
[attachment deleted by admin]
Max:
Dear dev,
I read the latest commit
Rev 5438 - mortenmacfly - Go to most recent revision
Last modification: Rev 5438 - 2009-02-04 14:11:23 GMT
Log message: * encoding detector: using system locale as backup-solution has returned
- encoding detector: added some more messages, helping to track errors
I'm going to read the related code to understand the change but, in the meantime, I'd lke to remind you of a bad (IMHO) behavior heppened in the past. When the detecting is failing I do believe that the best choice is to use the encoding "preferred" by the programmer, not the system locale. In the end the programmer knows what is doing, if he made a choice of a default encoding that one is the "standard one" for programming.
Basically, regardless of any windows default or verification, the programmer should have the capability to force CB using any encoding the programmer likes (IMHO).
For example my preferred encoding is the old, reliable, read-by-any-editor ASCII file, say the ISO-8859-1. I'm sure I will able to read my files in any OS even after ages.
So, it will be very kind of you if, in the end, there is the possibility to force an encoding regardless of any test/verification/check.
Thanks
Max
Jenna:
--- Quote from: MaxGaspa on February 04, 2009, 09:58:32 pm ---I read the latest commit
...
Basically, regardless of any windows default or verification, the programmer should have the capability to force CB using any encoding the programmer likes (IMHO).
...
--- End quote ---
You are absolutely right.
Exact that's the cause for the following commit (commited about 6 hours before your post):
--- Quote ---Revision 5439 - mortenmacfly
Letzte Änderung: Revision 5439 - 2009-02-04 15:35:09 GMT
Logeintrag: - encoding detector: make fallback solution optional (to explicitely force a user to enable the fallback solution)
--- End quote ---
JGM:
Wow it has been almost a whole year since i left c++ development on the dust I need to check all the new features of codeblocks!
Great work guys :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version