Skip to content

Instantly share code, notes, and snippets.

@greg-hellings
Created April 15, 2013 18:37
Show Gist options
  • Save greg-hellings/5390284 to your computer and use it in GitHub Desktop.
Save greg-hellings/5390284 to your computer and use it in GitHub Desktop.
wchar_t* _str_to_utf16(const char *str) {
static sword::UTF8UTF16 filter;
sword::SWBuf swStr = str;
printf("input:\t\t%s\n", swStr.c_str());
filter.processText(swStr, NULL, NULL);
printf("output:\t\t%ls\n", (wchar_t*)swStr.getRawData());
return (wchar_t*) swStr.getRawData();
}
extern "C" int sw_access(const char *filename, int mode) {
#ifdef WIN32
wchar_t *wfilename = _str_to_utf16 (filename);
printf("wfilename:\t%ls\n", wfilename);
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment