Author Topic: Last standing unicode problem  (Read 25213 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Last standing unicode problem
« Reply #30 on: December 21, 2005, 09:17:27 pm »
In http://forums.codeblocks.org/index.php?topic=1693.0 280Z28 might have stated a solution for the unicode problem. Look at this:
Code
wxString str;
str.Printf(_T("MyString%d"), 5);
This should result in a unicode compatible "MyString5". Does this help?
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Last standing unicode problem
« Reply #31 on: December 21, 2005, 10:18:02 pm »
In fact, it basically never it, since to be unicode it's have to be UTF-32 ( otherwise you'd have surrogate troubles ) and I've never seen a numeric_limits<wchar_t>::digits large enough for that to be possible.
On my FC4 box, sizeof(wchar_t) says 4.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Last standing unicode problem
« Reply #32 on: December 21, 2005, 10:22:40 pm »
Actually making a u2s (unsigned int to string) function isn't that hard... just keep dividing over 10 and concatenating to a string (it produces a reversed number). Then you just reverse the elements and ta-da :)

anonuser

  • Guest
Re: Last standing unicode problem
« Reply #33 on: December 22, 2005, 12:19:16 am »
a wchar_t will always hold a unicode character as long as you're going by GNU standards.
So there should be no problem.