News:

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

Main Menu

Last standing unicode problem

Started by mandrav, November 24, 2005, 02:02:40 PM

Previous topic - Next topic

killerbot

just curious, why is STL not acceptable ??

Not portable with selection ansi/unicode ??

mandrav

Quote from: killerbot on December 02, 2005, 01:09:42 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...

Michael

Quote from: mandrav on December 02, 2005, 01:36:56 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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

takeshimiya

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. :?

mandrav

Quote from: Takeshi Miya 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?

Unfortunately, no :)

Quote from: Takeshi Miya on December 02, 2005, 02:21:21 PM
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...

rickg22

Oh well...  :| I guess there's nothing else we can do.

me22

Quote from: MortenMacFly on December 02, 2005, 12:19:16 PM
Just curious, but does this work-around work?:

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:

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.

MortenMacFly

Quote from: me22 on December 02, 2005, 04:46:26 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

undofen

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

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

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

#26
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                     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)

anonuser

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?

me22

Quote from: anonuser 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?
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