Adriaan
> See Subject line. Any suggestions very appreciated :)
// strcopyToWide - assumes large enough. casts are so high byte is 0.
void strcopyToWide(wchar_t * dest, char *src){
while('\0' != *src){ *dest++ = (wchar_t ) (unsigned char) *src++; }
*dest++ = *src++;
}
As stated, your question is meaningless. What character sets are the
source strings in, and what character set is the dest string in?
The algorithm for converting between a char* holding macintosh
WorldscriptII Japanese going to 16-bit per char Unicode is very
different from the algorithm for going from a char * of UTF-8 to
Unicode, for example.
You might like to look at the documentation for two of Apple's mavinitsh
"Managers":
http://developer.apple.com/techpubs/macos8/TextIntlSvcs/ATSUI/atsui.html
ATSUI - Apple Text Services for Unicode Imaging (ATSUI is a pun in
Japanese) and
Text Encoding Conversion Manager.
http://developer.apple.com/techpubs/macos8/TextIntlSvcs/TextEncodingConve
rsionManager/tecmgr.html
> See Subject line. Any suggestions very appreciated :)
>
> Adriaan
Won't swprintf work?
#include <wchar.h>
int main()
{
wchar_t wstr[100];
char buffer [100]= "able was I ere I saw elba";
swprintf(wstr, 100, L"%ls",buffer);
wprintf(L"%s", wstr);
}
--
Create Java applications from desktop to wireless devices
using Sun's J2SE(tm), PersonalJava(tm) and J2ME(tm)
http://www.metrowerks.com/java/
Metrowerks "Software Starts Here" MW...@metrowerks.com