Author Topic: Unicode conversion (attention all devs)  (Read 67165 times)

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: Unicode conversion (attention all devs)
« Reply #105 on: August 23, 2005, 11:20:13 am »
In the case I cited before, i guess there is an error then, _T is used instead of _U! In unicode build, I don't think there is any conversion to perform to the string, or maybe I still do not understand the whole thing? The parsing consists of reading string in the project files (non-unicode files I think) and compare those string to something expected. Am I wrong?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Unicode conversion (attention all devs)
« Reply #106 on: August 23, 2005, 05:49:58 pm »
_T or wxT only adds an L before the string (ONLY if you're in a unicode build).

Example:

_T("hello there" becomes "hello there" in ansi.
_T("hello there") becomes L"hello there" in unicode.

but if you deal with functions that return strings, you must use our _U macro:

_U(hello_there()) becomes lotsastuffyoudontwanttoknow(hello_there()) in unicode.

The lesson is: if you're using wxString, you MUST use conversion macros.

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: Unicode conversion (attention all devs)
« Reply #107 on: September 05, 2005, 10:23:48 pm »
I've tried to extract the gist of all thess posts to a page on the wiki.  I must note that I haven't really used these macros yet so the content is probably grouped badly.  Also, I don't know that much about editing wiki pages.  With that said, the ugly first attempt is under the wiki main page->articles->Under "Development" section chose "Unicode Standards".
 
   It's not pretty, but it's a starting point for future revision.  It is an attempt to remove the need to go through all of the current 8 pages of the Unicode stuff.  It does need work, and maybe somebody whose gone the pain of the conversion (& knows wiki better) can make it look better.
Joe M.
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline gfgfd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Unicode conversion (attention all devs)
« Reply #108 on: September 11, 2005, 12:16:50 pm »
finally got codebooks to compile.. :D  with few changes tho..
i'm using gentoo, wx 2.6.1 unicode & cvs c::b

Code
Index: src/plugins/codecompletion/ccoptionsdlg.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/codecompletion/ccoptionsdlg.cpp,v
retrieving revision 1.7
diff -u -r1.7 ccoptionsdlg.cpp
--- src/plugins/codecompletion/ccoptionsdlg.cpp 8 Sep 2005 12:54:46 -0000 1.7
+++ src/plugins/codecompletion/ccoptionsdlg.cpp 11 Sep 2005 09:49:49 -0000
@@ -91,7 +91,7 @@
  XRCCTRL(*this, "chkLocals", wxCheckBox)->SetValue(m_Parser.Options().followLocalIncludes);
  XRCCTRL(*this, "chkGlobals", wxCheckBox)->SetValue(m_Parser.Options().followGlobalIncludes);
  XRCCTRL(*this, "chkPreprocessor", wxCheckBox)->SetValue(m_Parser.Options().wantPreprocessor);
- XRCCTRL(*this, "chkNoCC", wxCheckBox)->SetValue(ConfigManager::Get()->Read("/code_completion/use_code_completion", 1L) == 0);
+ XRCCTRL(*this, "chkNoCC", wxCheckBox)->SetValue(ConfigManager::Get()->Read(_T("/code_completion/use_code_completion"), 1L) == 0);
  XRCCTRL(*this, "chkSimpleMode", wxCheckBox)->SetValue(!m_Parser.Options().useSmartSense);
  XRCCTRL(*this, "chkCaseSensitive", wxCheckBox)->SetValue(m_Parser.Options().caseSensitive);
  XRCCTRL(*this, "chkInheritance", wxCheckBox)->SetValue(m_Parser.ClassBrowserOptions().showInheritance);
@@ -162,7 +162,7 @@
  m_Parser.Options().followGlobalIncludes = XRCCTRL(*this, "chkGlobals", wxCheckBox)->GetValue();
  m_Parser.Options().wantPreprocessor = XRCCTRL(*this, "chkPreprocessor", wxCheckBox)->GetValue();
  m_Parser.Options().caseSensitive = XRCCTRL(*this, "chkCaseSensitive", wxCheckBox)->GetValue();
- ConfigManager::Get()->Write("/code_completion/use_code_completion", !XRCCTRL(*this, "chkNoCC", wxCheckBox)->GetValue());
+ ConfigManager::Get()->Write(_T("/code_completion/use_code_completion"), !XRCCTRL(*this, "chkNoCC", wxCheckBox)->GetValue());
  m_Parser.Options().useSmartSense = !XRCCTRL(*this, "chkSimpleMode", wxCheckBox)->GetValue();
  m_Parser.ClassBrowserOptions().showInheritance = XRCCTRL(*this, "chkInheritance", wxCheckBox)->GetValue();
  m_Parser.ClassBrowserOptions().viewFlat = XRCCTRL(*this, "cmbCBView", wxComboBox)->GetSelection() == 0;
Index: src/plugins/compilergcc/compilerMINGW.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/compilergcc/compilerMINGW.cpp,v
retrieving revision 1.32
diff -u -r1.32 compilerMINGW.cpp
--- src/plugins/compilergcc/compilerMINGW.cpp 7 Sep 2005 09:55:50 -0000 1.32
+++ src/plugins/compilergcc/compilerMINGW.cpp 11 Sep 2005 09:49:49 -0000
@@ -80,11 +80,12 @@
  _T("-O -O1 -O2 -O3 -Os"),
  _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
 #ifdef __WXMSW__
-    #define GPROF_LINK "-pg -lgmon"
+    #define GPROF_LINK _T("-pg -lgmon")
 #else
-    #define GPROF_LINK "-pg"
+    #define GPROF_LINK _T("-pg")
+           
 #endif
- m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), _T(GPROF_LINK));
+ m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), GPROF_LINK);
 
     wxString category = _("Warnings");
 
Index: src/src/main.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/src/main.cpp,v
retrieving revision 1.94
diff -u -r1.94 main.cpp
--- src/src/main.cpp 8 Sep 2005 07:55:20 -0000 1.94
+++ src/src/main.cpp 11 Sep 2005 09:49:50 -0000
@@ -442,7 +442,7 @@
     pDockWindow1 = new wxDockWindow( this, 0, _("Management"), wxPoint( 64, 64 ), wxSize( leftW, clientsize.GetHeight() ) );
     pDockWindow1->SetClient( m_pNotebook );
 
-    pDockWindow2 = new wxDockWindow( this, 0, _("Messages"), wxPoint( 96, 96 ), wxSize( clientsize.GetWidth(), bottomH ), "d1" );
+    pDockWindow2 = new wxDockWindow( this, 0, _("Messages"), wxPoint( 96, 96 ), wxSize( clientsize.GetWidth(), bottomH ), _("d1") );
     pDockWindow2->SetClient( Manager::Get()->GetMessageManager() );
 
     // setup dockmanager

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Unicode conversion (attention all devs)
« Reply #109 on: September 11, 2005, 03:54:42 pm »
Thanks for the patch :)
Was the build process easy/correct?
Did you encounter any other problems, besides those unicode issues?
I 'm asking because the autotools build system is fairly new and I 'm still gathering feedback.
Be patient!
This bug will be fixed soon...

Offline gfgfd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Unicode conversion (attention all devs)
« Reply #110 on: September 11, 2005, 06:29:01 pm »
no problems.. builds and runs just fine :)