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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Last standing unicode problem
« Reply #15 on: December 02, 2005, 01:09:42 pm »
just curious, why is STL not acceptable ??

Not portable with selection ansi/unicode ??

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Last standing unicode problem
« Reply #16 on: December 02, 2005, 01:36:56 pm »
just curious, why is STL not acceptable ??

Not portable with selection ansi/unicode ??

For starters, STL is not enabled by default in wxWidgets configuration.
And even, if enabled, we 'd have tons of problems with wxWidgets and STL (tried it). Not to mention the unicode issues...

EDIT: don't get me wrong, in my own non-wx projects I use STL all the time. I don't know what I would have done without it ;)
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Last standing unicode problem
« Reply #17 on: December 02, 2005, 01:51:32 pm »
EDIT: don't get me wrong, in my own non-wx projects I use STL all the time. I don't know what I would have done without it ;)
Sorry for the question, but what do you use instead of STL in your wx projects?

Thank you.

Best wishes,
Michael

takeshimiya

  • Guest
Re: Last standing unicode problem
« Reply #18 on: December 02, 2005, 02:21:21 pm »
And I can add: Sorry for the question :), but what are your non-wx projects? Something opensource?

Back on topic:
I've diff-compared the string related code from 2.6.1 and 2.6.2 and found nothing relevant. :?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Last standing unicode problem
« Reply #19 on: December 02, 2005, 02:32:46 pm »
And I can add: Sorry for the question :), but what are your non-wx projects? Something opensource?

Unfortunately, no :)

Back on topic:
I've diff-compared the string related code from 2.6.1 and 2.6.2 and found nothing relevant. :?

Yes, I know. It makes no sense at all...
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Last standing unicode problem
« Reply #20 on: December 02, 2005, 04:18:23 pm »
Oh well...  :| I guess there's nothing else we can do.

Offline me22

  • Official tester
  • Multiple posting newcomer
  • ***
  • Posts: 53
    • TA Universe
Re: Last standing unicode problem
« Reply #21 on: December 02, 2005, 04:46:26 pm »
Just curious, but does this work-around work?:
Code
std::string str;
str << "Hi" << 5;
wxString str_new(_T(str));

Please notice that I've used default std::string for the first one.
(I cannot test it at the moment since I am at work.)

Morten.
That wont work because std::string doesn't have formatting -- you'd use a stringstream for that:
Code
std::basic_stringstream<wxChar> ss;
ss << "Hi" << 5;
wxString str_new( ss.str() );
( because iostreams keep all the formatting information in istream and ostream, to avoid excessive duplication )

Note that I do not think this would be a good solution.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Last standing unicode problem
« Reply #22 on: December 03, 2005, 01:22:10 pm »
That wont work because std::string doesn't have formatting [...]
I know about that. This was a copy&paste mistake because I had posted this already in another thread using wxString instead of std::string. But i found out that this had already been tested in this thread...

I was hoping that nobody would realise... :oops: :oops: :oops:

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

undofen

  • Guest
Re: Last standing unicode problem
« Reply #23 on: December 04, 2005, 03:44:34 am »
I'm not sure if thats so easy to do, but I would really appreciate if anyone could write down a "not nice but working" solution to this, a solution that I could just paste into that place in the file and make codeblocks usable until the right fix is found. I tried to convert that number to a string but I only know the basics of c++ and dont know anything about wx so it didnt work ;-). TIA

andrimar

  • Guest
Re: Last standing unicode problem
« Reply #24 on: December 04, 2005, 04:06:26 am »
We could go the old QT <-> KDE relationship way and wrap our workaround in an extended wxString class. That way we wouldn't have to change wx internals, keeping distro makers and users happy. Just my 2 cents on the matter after reading this thread but no related code. Hope it inspires someone :)

takeshimiya

  • Guest
Re: Last standing unicode problem
« Reply #25 on: December 04, 2005, 05:17:56 am »
I don't know if this helps, but from the wxWiKi:

Converting an integer to wxString

To convert, for example, an integer to a wxString, you can use several methods:

    * wxString mynewstring = wxString::Format("%d", myoldinteger)
    * wxString s; s.Printf("%d", myint);
    * wxString mynewstring = wxString("") << myoldinteger;


If you're going straight into a text control, you can skip the conversion entirely: *textctrl << myint;


undofen

  • Guest
Re: Last standing unicode problem
« Reply #26 on: December 10, 2005, 02:43:12 pm »
using the latest rocket engeeniering and the post above I developed this fix, I suppose its not the best solution, but if someone wants a working debugger with wx-2.6.2 and knows nothing about codeblocks it should be enough:
in /src/plugins/debuggergdb/gdb_commands.h , lines ~ 200
Code
                    if (!m_BP->temporary)
                        m_Cmd << _T("break ");
                    else
                        m_Cmd << _T("tbreak ");
++                  wxString s; s.Printf(_("%d"), m_BP->line + 1);
++                    m_Cmd << out << _T(":") << s;
--                       m_Cmd << out << _T(":") << m_BP->line + 1;
                }

EDIT: the debugger is working now, a pity though it's not highlighting the actual line, nor any other line (breakpoint line, error line)
« Last Edit: December 10, 2005, 02:45:04 pm by undofen »

anonuser

  • Guest
Re: Last standing unicode problem
« Reply #27 on: December 10, 2005, 06:42:39 pm »
There shouldn't be any unicode issue with the STL.

there's wstring and string. wstring being the wide character version which is also capable of doing unicode.
Perhaps there is an issue with wxString?

Offline me22

  • Official tester
  • Multiple posting newcomer
  • ***
  • Posts: 53
    • TA Universe
Re: Last standing unicode problem
« Reply #28 on: December 10, 2005, 08:14:15 pm »
There shouldn't be any unicode issue with the STL.

there's wstring and string. wstring being the wide character version which is also capable of doing unicode.
Perhaps there is an issue with wxString?
Unfortunatly, wstring is not guaranteed to be unicode =(

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.

anonuser

  • Guest
Re: Last standing unicode problem
« Reply #29 on: December 10, 2005, 09:04:40 pm »
not according to the gnu standard. wchar must be 32 bits wide. http://www.gnu.org/software/libc/manual/html_node/Extended-Char-Intro.html for more info.