UCS-2 to wxString

24 views
Skip to first unread message

iko...@earthlink.net

unread,
Nov 7, 2009, 6:37:04 PM11/7/09
to wx-u...@googlegroups.com
Hi, ALL,
How do I perform such conversion?
I'm using TRUNK and it looks like I don't have to do anything
on Windows, just write:

wxString test = wxString("UCS-2 string");

However, on Linux I am getting an assert on this.

Thank you.

Iulian-Nicu Șerbănoiu

unread,
Nov 8, 2009, 2:32:27 AM11/8/09
to wx-u...@googlegroups.com
On Sun, Nov 8, 2009 at 1:37 AM, <iko...@earthlink.net> wrote:
>
> Hi, ALL,

Hi,

> How do I perform such conversion?
> I'm using TRUNK and it looks like I don't have to do anything
> on Windows, just write:
>
> wxString test = wxString("UCS-2 string");

On windows the wchar_t size is 2 which is matches the UCS-2 encoding.
On linux the wchar_t size is 4 (at least in my case - Ubuntu 32/64
bit) and it doesn't work directly.

You could use this:
http://docs.wxwidgets.org/stable/wx_wxmbconvutf16.html#wxmbconvutf16

>
> However, on Linux I am getting an assert on this.
>
> Thank you.
>

Regards,
>
>

--
Iulian Şerbănoiu
MinVG - http://minvg.sourceforge.net

Jim

unread,
Nov 8, 2009, 5:08:50 AM11/8/09
to wx-users
Hi,

I have some problems compiling wxwidgets for WinCE. I'm using MS
eMbedded Visual C 4.0 that works well for other applications and try
to compile as DLL for the Emulator.

First of all wxWidgets complains about

"Unknown SDK, please fill-in missing pieces"

That's easy to solve, I simply added __WINCE_STANDARDSDK__ to the
preprocessor definitions. With these settings the mono-subproject
fails with linker errors that point to AUI and Multimedia - things I
do not need for CE. What am I doing wrong here?

Jim

Vadim Zeitlin

unread,
Nov 8, 2009, 10:33:16 AM11/8/09
to wx-u...@googlegroups.com
On Sun, 8 Nov 2009 02:08:50 -0800 (PST) Jim <ope...@googlemail.com> wrote:

J> I have some problems compiling wxwidgets for WinCE. I'm using MS
J> eMbedded Visual C 4.0 that works well for other applications and try
J> to compile as DLL for the Emulator.

I'm afraid you won't find much help with eVC here, everybody who ever use
it fled from it like from plague as soon as it was possible and started
using VC2005/2008 which is the only supported way to build wxWinCE nowadays.

J> First of all wxWidgets complains about
J>
J> "Unknown SDK, please fill-in missing pieces"
J>
J> That's easy to solve, I simply added __WINCE_STANDARDSDK__ to the
J> preprocessor definitions.

AFAIR using standard SDK is usually not what you want but I could be
wrong, WinCE variants/SDK definitions are rather confusing.

J> With these settings the mono-subproject fails with linker errors that
J> point to AUI and Multimedia - things I do not need for CE. What am I
J> doing wrong here?

Probably nothing, it's just that nobody used eVC for building wx in a very
long time AFAIK. Anyhow, where do you get references to aui/media library?
It shouldn't be difficult to fix this (but, again, you will mostly be on
your own when using this compiler).

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Jim Hart

unread,
Nov 8, 2009, 11:27:26 AM11/8/09
to wx-u...@googlegroups.com
Hm, that doesn't sounds promising...
The funny thing is: When I build wxWidgets using eVC as statically linked libraries I do not have these problems, there are no linker errors also when the application itself is built. So I would assume thare are some - more or less simple - switches missing for the DLL build?
Btw, these are the exact errors I get:
mediactrlcmn.obj : error LNK2019: unresolved external symbol "void __cdecl _wx_link_dummy_func_wxmediabackend_am(void)" (?_wx_link_dummy_func_wxmediabackend_am@@YAXXZ) referenced in function _$E296
mediactrlcmn.obj : error LNK2019: unresolved external symbol "void __cdecl _wx_link_dummy_func_wxmediabackend_wmp10(void)" (?_wx_link_dummy_func_wxmediabackend_wmp10@@YAXXZ) referenced in function _$E299
stdpaths.obj : error LNK2019: unresolved external symbol __imp__SHGetMalloc referenced in function "protected: static class wxString __cdecl wxStandardPaths::DoGetDirectory(int)" (?DoGetDirectory@wxStandardPaths@@KA?AVwxString@@H@Z)
stdpaths.obj : error LNK2019: unresolved external symbol __imp__SHGetPathFromIDList referenced in function "protected: static class wxString __cdecl wxStandardPaths::DoGetDirectory(int)" (?DoGetDirectory@wxStandardPaths@@KA?AVwxString@@H@Z)
stdpaths.obj : error LNK2019: unresolved external symbol __imp__SHGetSpecialFolderLocation referenced in function "protected: static class wxString __cdecl wxStandardPaths::DoGetDirectory(int)" (?DoGetDirectory@wxStandardPaths@@KA?AVwxString@@H@Z)



2009/11/8 Vadim Zeitlin <va...@wxwidgets.org>



--
Kind regards

Jim Hart

--

http://www.openapc.com

Vadim Zeitlin

unread,
Nov 8, 2009, 11:31:13 AM11/8/09
to wx-u...@googlegroups.com
On Sun, 8 Nov 2009 17:27:26 +0100 Jim Hart <ope...@googlemail.com> wrote:

JH> Hm, that doesn't sounds promising...

No, but using eVC is really not much fun. If you can switch to VC8/9/10
(beta 2 is out and available for download) I strongly recommend that you
do.

JH> Btw, these are the exact errors I get:
JH> mediactrlcmn.obj : error LNK2019: unresolved external symbol "void __cdecl
JH> _wx_link_dummy_func_wxmediabackend_am(void)"
JH> (?_wx_link_dummy_func_wxmediabackend_am@@YAXXZ) referenced in function
JH> _$E296
JH> mediactrlcmn.obj : error LNK2019: unresolved external symbol "void __cdecl
JH> _wx_link_dummy_func_wxmediabackend_wmp10(void)"
JH> (?_wx_link_dummy_func_wxmediabackend_wmp10@@YAXXZ) referenced in function
JH> _$E299

You probably should just exclude this file from your build.

JH> stdpaths.obj : error LNK2019: unresolved external symbol __imp__SHGetMalloc
JH> referenced in function "protected: static class wxString __cdecl
JH> wxStandardPaths::DoGetDirectory(int)" (?DoGetDirectory@wxStandardPaths
JH> @@KA?AVwxString@@H@Z)
JH> stdpaths.obj : error LNK2019: unresolved external symbol
JH> __imp__SHGetPathFromIDList referenced in function "protected: static class
JH> wxString __cdecl wxStandardPaths::DoGetDirectory(int)"
JH> (?DoGetDirectory@wxStandardPaths@@KA?AVwxString@@H@Z)
JH> stdpaths.obj : error LNK2019: unresolved external symbol
JH> __imp__SHGetSpecialFolderLocation referenced in function "protected: static
JH> class wxString __cdecl wxStandardPaths::DoGetDirectory(int)"
JH> (?DoGetDirectory@wxStandardPaths@@KA?AVwxString@@H@Z)

Looks like missing shell library or these functions are not available
under CE (although why does it compile then?). This is SDK-depending so I
don't know which is the case.

iko...@earthlink.net

unread,
Nov 9, 2009, 10:30:43 PM11/9/09
to wx-u...@googlegroups.com
Hi, Iulian,

-----Original Message-----
>From: Iulian-Nicu Șerbănoiu <under...@gmail.com>
>Sent: Nov 7, 2009 11:32 PM
>To: wx-u...@googlegroups.com
>Subject: Re: UCS-2 to wxString
>
>
>On Sun, Nov 8, 2009 at 1:37 AM, <iko...@earthlink.net> wrote:
>>
>> Hi, ALL,
>
>Hi,
>
>> How do I perform such conversion?
>> I'm using TRUNK and it looks like I don't have to do anything
>> on Windows, just write:
>>
>> wxString test = wxString("UCS-2 string");
>
>On windows the wchar_t size is 2 which is matches the UCS-2 encoding.
>On linux the wchar_t size is 4 (at least in my case - Ubuntu 32/64
>bit) and it doesn't work directly.
>
>You could use this:
>http://docs.wxwidgets.org/stable/wx_wxmbconvutf16.html#wxmbconvutf16

This is what I tried:

wxString test = wxMBConvUTF16().cMB2WC( (const char *) string );

And in the "test" on Linux I am receiving this:

"\374\2715\b",

which is not what I would expect.

ALso, I'm not talking UTF-16 here, but rather UCS-2...

Thank you.
Reply all
Reply to author
Forward
0 new messages