wchar_t mbrtowc Method

Discussion about everything. New games, 3d math, development tips...
Post Reply
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

wchar_t mbrtowc Method

Post by Boogle »

I seem to be having an issue with this function. I wish to convert a char* to a wchar_t*, and have found that mbrtowc(...) seems to be what I want. However, when I try to compile my application when using this function, it cannot link to the method. It compiles the individual file fine but then the linker complains. I have included <wchar.h> at the top of my code but still no luck.

I'm using VS.NET.. has anyone else had issues with this? Have they managed to find out what the problem is? :)
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I don't know a solution for this problem, but you could go the dirty way, using Irrlichts string class:

Code: Select all

char* yourstring = "blablabla";
core::stringw s = yourstring;
// you can now access the wchar_t pointer with s.c_str()
This should also work the other way round:

Code: Select all

wchar_t* yourstring = L"blablabla";
core::stringc s = yourstring;
// you can now access the char pointer with s.c_str()
Post Reply