News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Unicode conversion (attention all devs)

Started by rickg22, August 04, 2005, 11:24:31 PM

Previous topic - Next topic

byo

Quote from: Ceniza on August 05, 2005, 11:32:51 PM

#ifdef wxUSE_UNICODE
        formattedText << wxString(formatter.nextLine().c_str(), wxConvLocal);
#else
        formattedText << formatter.nextLine().c_str();
#endif



Hmm, wont the first form work both in unicode and non-unicode version ? In files I've changed it works. It's in headers wxstring.h:

when in Unicode:

#if wxUSE_UNICODE
    // from multibyte string
  wxString(const char *psz, wxMBConv& conv, size_t nLength = npos);


when not:


  wxString(const wxChar *psz, wxMBConv& WXUNUSED(conv), size_t nLength = npos)
      : wxStringBase(psz, nLength == npos ? wxStrlen(psz) : nLength) { }

(here wxChar is equal to char)

so when in non-unicode version the secondargument wil be ignored.

Ceniza

So keeping it the evil way would work for both...

Well, I'll leave it that way (with the #ifdef) so the ASCII build won't need to create a wxString object unnecessarily.

I would also like to inform you the help plugin is ready for UNICODE too, but only in HEAD.

I just tried to commit the changes to the AStyle plugin and CVS rejected, so I'll e-mail them.

I'm gonna commit the help plugin changes to HEAD though.

rickg22

#47
~ code is tested Logically.

:? What is that supposed to mean? Anyway, I'm thinking it would be better if all the SDK changes were mailed to me personally.

Anyway guys, send me personal message (NOT mail!) for the changes in status. I'll modify the above table since i'm a webadmin, too ;-)

byo

#48
My current progress :

Edited by rick - changes posted above

Will handle the rest tomorrow :)

tiwag

#49
Quote from: rickg22 on August 06, 2005, 12:22:51 AM
~ code is tested Logically.
:? What is that supposed to mean?
...

it means - after your edited source code module is compiling without errors or warnings,
look what is this just edited module doing and test this functionality explicitly
in the newly built codeblocks.

ie
it is the last step before sending the modified files to YOU RICK !!

we could rename this symbol to "sent to rick"  :D

rickg22

You could change it for "tested live"

rickg22

Um... man i think tiwag's got the most difficult part!

(i detected one or two possible flaws)
But I have a doubt. Tiwag, have you tried importing MSVC projects and Dev-Cpp projects with the modified files?

tiwag

Quote from: rickg22 on August 06, 2005, 07:56:21 AM
Um... man i think tiwag's got the most difficult part!

(i detected one or two possible flaws)
But I have a doubt. Tiwag, have you tried importing MSVC projects and Dev-Cpp projects with the modified files?

no that i missed till now - will do it in a few hours

just now my wife is worried about my spare-time schedule  :shock: - i have to help her a few things now  :D

David Perfors

Quote from: tiwag on August 06, 2005, 10:24:02 AMjust now my wife is worried about my spare-time schedule  :shock: - i have to help her a few things now  :D
Yes always listen to your wife :lol: (ehm. well I think, I don't have a wife, not even a girl friend.  :( yet :lol:)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

byo

Quote from: mispunt on August 06, 2005, 10:49:21 AM
Quote from: tiwag on August 06, 2005, 10:24:02 AMjust now my wife is worried about my spare-time schedule  :shock: - i have to help her a few things now  :D
Yes always listen to your wife :lol: (ehm. well I think, I don't have a wife, not even a girl friend.  :( yet :lol:)

He he, maybe not always, husband can be right too (at least from time to time ;) ).
I haven't listen to my girlfriend much recently and now I see the results - the worst thing in the world is to have lot of spare time and nobody to share it with  :(.

BTW, progress:


////////////////////////////////////////
/// byo
group 15
o    replacedlg.cpp
o    replacedlg.h
o    sanitycheck.h
o    sdk_events.cpp
o    sdk_events.h
o    searchresultslog.cpp
o    searchresultslog.h
o    selecttargetdlg.cpp
o    selecttargetdlg.h
o    settings.h
o    simplelistlog.cpp
o    simplelistlog.h
o    simpletextlog.cpp
o    simpletextlog.h

tiwag

Quote from: byo on August 05, 2005, 11:29:57 PM
I try to compile changed sources in both Unicode and NonUnicode versions of wxWidgets (and after that in wx2.4 and wx2.6 to make sure it will work everywhere). Unfortunately all project can't be compiled in Unicode but separate files can :)

Hi byo

what unicode library have you built ? which OS are you using ?

currently i work only in Windows,
i thought about to build a "wxMSW-2.4.2-monolithic-unicode-DLL-debug" library
for testing the CodeBlocks VERSION_1_0_UNICODE .

i would like to discuss with you how to setup the best debug-environment for our new "baby"

in the future i would like to test also in Linux,
just now i have set up an Ubunto Hoary in a VM-ware box
it runs but i'm far away from compiling and testing something...
so testing in Linuxs means "mid-term future" for me
maybe starting in October 05 ... we'll see

byo

Quote from: tiwag on August 06, 2005, 12:14:46 PM
what unicode library have you built ? which OS are you using ?

currently i work only in Windows,
i thought about to build a "wxMSW-2.4.2-monolithic-unicode-DLL-debug" library
for testing the CodeBlocks VERSION_1_0_UNICODE .

i would like to discuss with you how to setup the best debug-environment for our new "baby"

in the future i would like to test also in Linux,
just now i have set up an Ubunto Hoary in a VM-ware box
it runs but i'm far away from compiling and testing something...
so testing in Linuxs means "mid-term future" for me
maybe starting in October 05 ... we'll see


I also work on Windows, testing on wx 2.6.1 (monolithic,dll)

I tried to run on Gentoo linux (with wx 2.6.1) but can't get it working (it crashes immediately - it was even discussed somewhere on the forum). Hmm, no, I've run it on 2.4 but it doesn't store configuration or something like that (it crashes when closing stardet but before saving configuration I suppose). But it wasn't sattisfying for me since my wxSmith plugin works only under 2.6.

Hmm, there's also one thing need mentioning - when building wxWidgets in debug mode (when assertions are enabled) it shows some assertions at the beginning (something about unknown parameters - when parsing command line) and some after but I don't remember them currently.

byo

Code from group 15 sent to rickg22 - You can update my info ;)

rickg22

#58
New macro defined!

I defined a new macro in "settings.h":

_U(). Use it to convert non-literal char* strings to wxString. Use it for reading attributes from TiXmlNode's.


#ifdef wxUSE_UNICODE
  #define _U(x) wxString((x),wxConvUTF8)
  #define _UU(x,y) wxString((x),y)
#else
  #define _U(x) (x)
  #define _UU(x,y) (x)
#endif

i.e.:


const char* incompatible = "This is an incompatible string";
wxString compatible = _U(incompatible);

// wxString conftype = conf->Attribute("ConfigurationType"); // before
wxString conftype = _U(conf->Attribute("ConfigurationType")); // after :)


I just hope I'm not reinventing the wheel here :P

byo

Quote from: rickg22 on August 06, 2005, 10:05:23 PM

#ifdef wxUSE_UNICODE
  #define _U(x) wxString((x),wxConvUTF8)
  #define _UU(x,y) wxString((x),y)
#else
  #define _U(x) (x)
  #define _UU(x,y) (x)
#endif


I guess that we should use wxConvUTF8 by default. I've seen that Ceniza uses wxConvLocal. Which one is better ? (Perhaps we will find out when localized versions of C::B will be released ;) ).

Hmm, I shouldn't worry about it. If it will be inside settings.h, jut few seconds and it will be changed  :lol: