Author Topic: The 02 February 2009 build (5432) is out.  (Read 57779 times)

Offline hying

  • Single posting newcomer
  • *
  • Posts: 7
Re: The 02 February 2009 build (5432) is out.
« Reply #15 on: February 04, 2009, 07:45:51 am »
a bug:
when open a file with some chinese character,
the edit window show nothing.

[attachment deleted by admin]

Offline gd_on

  • Lives here!
  • ****
  • Posts: 651
Re: The 02 February 2009 build (5432) is out.
« Reply #16 on: February 04, 2009, 10:10:34 am »
A small problem with file time, in file properties window, with C::B 8.02 and last nightly SVN 5436 (both compiled with gcc 3.4.6 and using wx 2.8.7).
With 8.02, minutes and seconds are wrong. With SVN 5436, only minutes are wrong, seconds are correct.
OS is Linux Redhat enterprise 4.7 in french.
No problem with Windows XP.

gd_on

[attachment deleted by admin]
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: The 02 February 2009 build (5432) is out.
« Reply #17 on: February 04, 2009, 10:34:30 am »
a bug:
when open a file with some chinese character,
the edit window show nothing.

This situation happend on me:

windows xp (Chinese)
Code::Blocks svn 5432

step1: Setting->Editor:
   Use encoding when opening files: UTF8
   checked:  As fallback encoding 

step2 : Now open a file which saved with "GB2312" encoding..

   editor show nothing.

but when i open the same file by notepad, everything ok.



[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9614
Re: The 02 February 2009 build (5432) is out.
« Reply #18 on: February 04, 2009, 11:58:28 am »
This situation happend on me:
   editor show nothing.
That's not a bug. C::B does exactly what you tell him to do:
You provide an ANSI file with "non-ANSI" characters. Then you tell C::B to try to detect the encoding which fails. You tell C::B "In that situation use UTF-8 as fallback" but your file is not UTF-8. Thus C::B fails again. The result: An empty file.

Choose the right encoding in the first place (when you create the file) I'd say.

To match the settings you have currently in C::B you need a file in UTF-8. Thus open your file in notepad (if you like), choose "Save-as" and "UTF-8" as format. Then it'll work in C::B.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 02 February 2009 build (5432) is out.
« Reply #19 on: February 04, 2009, 12:04:47 pm »
Nevertheless, there seems to be an encoding bug in actual nightly, what is fixed in trunk.
See here: http://forums.codeblocks.org/index.php/topic,10040.msg69822.html#msg69822.

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: The 02 February 2009 build (5432) is out.
« Reply #20 on: February 04, 2009, 05:40:23 pm »
Quote
You provide an ANSI file with "non-ANSI" characters.

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.

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..
 


« Last Edit: February 04, 2009, 05:42:05 pm by nanyu »

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: The 02 February 2009 build (5432) is out.
« Reply #21 on: February 04, 2009, 07:08:00 pm »
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]
« Last Edit: February 04, 2009, 07:22:17 pm by nanyu »

Max

  • Guest
Re: The 02 February 2009 build (5432) is out.
« Reply #22 on: February 04, 2009, 09:58:32 pm »
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
 

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 02 February 2009 build (5432) is out.
« Reply #23 on: February 04, 2009, 11:00: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).
...

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)


Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: The 02 February 2009 build (5432) is out.
« Reply #24 on: February 05, 2009, 02:27:46 am »
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

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 02 February 2009 build (5432) is out.
« Reply #25 on: February 05, 2009, 04:36:42 am »
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.
The same question. so i have to use SVN 5431!

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
wxSmith Bug!
« Reply #26 on: February 05, 2009, 04:40:22 am »
I can't set size. it's not work.
I found it's always call 'SetSizeHints'.
Code
Index: src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp (revision 5440)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp (working copy)
@@ -215,7 +215,7 @@
                         Codef(_T("%sFit(%O);\n"),ChildAccessPrefix.c_str());
                     }
 
-                    Codef(_T("%sSetSizeHints(%O);\n"),ChildAccessPrefix.c_str());
+                    //Codef(_T("%sSetSizeHints(%O);\n"),ChildAccessPrefix.c_str());
                 }
             }

[attachment deleted by admin]
« Last Edit: February 05, 2009, 08:37:49 am by Loaden »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9614
Re: The 02 February 2009 build (5432) is out.
« Reply #27 on: February 05, 2009, 08:48:33 am »
Log message:   * encoding detector: using system locale as backup-solution has returned

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.
Don't worry: This "feature" is optional. I don't like it, too because it "fixes" nothing but just tries to help the "dumb user" to get the right encoding. For professionals this can be turned off in the settings.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5346
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith Bug!
« Reply #28 on: February 05, 2009, 09:11:29 am »
I can't set size. it's not work.
I found it's always call 'SetSizeHints'.
Code
Index: src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp (revision 5440)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp (working copy)
@@ -215,7 +215,7 @@
                         Codef(_T("%sFit(%O);\n"),ChildAccessPrefix.c_str());
                     }
 
-                    Codef(_T("%sSetSizeHints(%O);\n"),ChildAccessPrefix.c_str());
+                    //Codef(_T("%sSetSizeHints(%O);\n"),ChildAccessPrefix.c_str());
                 }
             }
You should report this bug here wxsmith development thread:
http://forums.codeblocks.org/index.php/topic,372.150.html
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Sunyata

  • Single posting newcomer
  • *
  • Posts: 5
Re: The 02 February 2009 build (5432) is out.
« Reply #29 on: February 05, 2009, 12:10:14 pm »
Hi guys,

Thank you for the efforts making the CodeBlocks perfect.

I've found one bug here, ->
The CodeBlocks can't run more than one instance even though the option (Allow only one running instance) has been removed.