Author Topic: unicode question  (Read 3998 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
unicode question
« on: June 23, 2006, 04:37:26 pm »
For many of you this will be trivial, but I am still sorting this thing out :
UNICODE :

say I have created with CB a simple console application :

int main(int argc, char** argv)
{
}

on the inside of my program I want to use unicode (by using wx in unicode), say :
wxString test;

In test I want to get argv[1], but that one is not unicode. How should I convert ?

Secondly, what will happen if my little program is run for example on a russion/chines/arabic os, and the specify unicode character string on the command line. Hopefully 'all bytes' of it will enter the argv, zero terminated (so let's hope no 0's in the middle) ?

I assume I am still missing some things, please fill me in.

many thanks,
Lieven

takeshimiya

  • Guest
Re: unicode question
« Reply #1 on: June 23, 2006, 06:07:43 pm »
Look here: http://www.wxwindows.org/manuals/2.6.3/wx_wxcmdlineparser.html
and here: http://www.wxwidgets.org/wiki/index.php/Command-Line_Arguments

main(int argc, char** argv) will give you an unicode string in some platforms, where in some other platforms main(int argc, wchar_t** argv) will give you the unicode string.

So read the two links above for the rest of the history :)