Author Topic: Can't get correct UTF-8 display in text panel in my XP system  (Read 8599 times)

Offline SamT

  • Multiple posting newcomer
  • *
  • Posts: 41
Can't get correct UTF-8 display in text panel in my XP system
« on: February 03, 2006, 03:05:37 pm »
Hi,

Today, when I use C::B to open C::B source code, some of the files can be opened but can't display in text panel. It's really amazing to have this problem.
After several files comparison, I find out there exist some Chinese characters (code in UTF-8) will be the root cause. Please refere the C::B source file of ./src/src/app.cpp (line 23), ./src/src/dlgabout.cpp (line 23). After I delete the character, the file can be display correctly.

Does anyone encounter the same problem?
I use Version 1.0 revision 1935 on XP(multi language with Chinese Character support)

Take the picture as the example.


[attachment deleted by admin]

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #1 on: February 03, 2006, 03:20:28 pm »
That is a known issue, it also happens with Umlauts (or any diacritics, for that matter). And unluckily, we probably won't be able to fix it any time soon, either.

I'll try to find out how we can prevent Subversion to write out non-compliant characters in the first place, there sure is a way... (in fact, I know at least three ways to do that, but they all require the individual user to modify something, that's not the desired solution).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #2 on: February 03, 2006, 04:20:28 pm »
The bad news:
I had hoped that it was possible to either set a property in the repository or to change a server configuration switch so that dates are always generated in English for everybody.
This is not possible, as keyword substitution is done locally by your svn client, according to your system language settings, and it cannot be controlled repository-wide. :(
So much about the benefits of localised applications...

The good news:
The two files which cause a problem to you use the $Date$ keyword which substitutes the local date and time in long format (something like "Friday, January 6, 2006"), resulting in the very problem you described. The $Id$ field, however, already contains a date (in ISO format), which means that we can obsolete the $Date$ keyword. I will globally replace the $Id$ keyword during the next half hour.

Hopefully, this will solve the problem for you (it it does not, you have to change your language settings for Subversion).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #3 on: February 03, 2006, 05:04:01 pm »
Try again now. 1940 should not show that problem any more (although the problem as such is of course not solved).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline SamT

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #4 on: February 03, 2006, 05:27:01 pm »
Try again now. 1940 should not show that problem any more (although the problem as such is of course not solved).

 :mrgreen: This is some thing like a workaround solution for me. Thanks! However, I am curious about the reason to correctly display in Notepad ++. Does it use the same engine of Scintilla? I am not familar about the program design because I am just new in coding. So... Please forgive for my stupid question.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #5 on: February 03, 2006, 05:37:10 pm »
No idea about Notepad++, sorry.

All I can say is that our version of wxScintilla does not cope well with non-Western characters. It may be an actual bug in wxScintilla, but it may as well be that we're not using it properly. Who knows... :lol:

To date, the only thing to do is to avoid having offending characters in the source file...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #6 on: February 03, 2006, 07:17:04 pm »
No idea about Notepad++, sorry.

I was interested in this tool and after a google serach I found it:

Quote
Notepad++ is a free source code editor which supports several programming languages running under the MS Windows environment.

This project, based on Scintilla edit component (a very powerful editor component) are written in C++ with pure win32 api and STL (that ensures the higher execution speed and smaller size of the program), is under the GPL Licence.
...

Michael

takeshimiya

  • Guest
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #7 on: February 03, 2006, 09:13:49 pm »
No idea about Notepad++, sorry.

All I can say is that our version of wxScintilla does not cope well with non-Western characters. It may be an actual bug in wxScintilla, but it may as well be that we're not using it properly. Who knows... :lol:

To date, the only thing to do is to avoid having offending characters in the source file...

If someone would ever cared to review the patches from 280Z28, this problem has been fixed long time ago. :(

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #8 on: February 04, 2006, 01:53:00 am »
After several files comparison, I find out there exist some Chinese characters (code in UTF-8) will be the root cause.

Maybe because of this, I can't use internationlized CB with unicode under Windows XP and Windows 2000 and FreeBSD. Sometimes it's successful under Windows 2000 server. I'm looking for the way.

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #9 on: February 04, 2006, 06:51:58 am »
Quote
The good news:
The two files which cause a problem to you use the $Date$ keyword which substitutes the local date and time in long format (something like "Friday, January 6, 2006"), resulting in the very problem you described. The $Id$ field, however, already contains a date (in ISO format), which means that we can obsolete the $Date$ keyword. I will globally replace the $Id$ keyword during the next half hour.

Hopefully, this will solve the problem for you (it it does not, you have to change your language settings for Subversion).

This way can't solve all the problem for example non-English characters exists in other place of sources.  After I change the sources' page code to ansi not utf-8 or unicode, all work well.   However I am wondering why it happens that the same sources which page code is utf-8 or unicode,  it shows correctly in some editors like editplus but incorrectly in wxScintilla + wxwidgets.

takeshimiya

  • Guest
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #10 on: February 04, 2006, 07:20:01 am »
Come on, this bug has been solved some weeks ago by the patches from 280Z28.

http://forums.codeblocks.org/index.php?topic=1833.0 and some other threads.....................

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #11 on: February 04, 2006, 10:27:49 am »
Come on, this bug has been solved some weeks ago by the patches from 280Z28.

As has been said numerous times, if a patch is not posted to sourceforge there is no way it will ever get applied. As you may have noticed, there are some days when I sit and evaluate (and apply) the sf patches. I 'm not going to search through the forums to see if someone has posted somewhere a patch...
Be patient!
This bug will be fixed soon...

takeshimiya

  • Guest
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #12 on: February 04, 2006, 09:24:29 pm »
Come on, this bug has been solved some weeks ago by the patches from 280Z28.

As has been said numerous times, if a patch is not posted to sourceforge there is no way it will ever get applied. As you may have noticed, there are some days when I sit and evaluate (and apply) the sf patches. I 'm not going to search through the forums to see if someone has posted somewhere a patch...


No problem, just so you know it has been fixed and don't waste time.
280Z28 where are your updated patches?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Can't get correct UTF-8 display in text panel in my XP system
« Reply #13 on: February 04, 2006, 09:35:05 pm »
No problem, just so you know it has been fixed and don't waste time.
280Z28 where are your updated patches?

Never mind. I evaluated it today, adjusted it to current SVN and testing it. If all goes well, I 'll add it tomorrow.
Be patient!
This bug will be fixed soon...