On Tue, 1 Nov 2011 16:27:35 +0100 (CET) Vincent Torri <vto...@univ-evry.fr> said:
> > > On Tue, 1 Nov 2011, Carsten Haitzler (The Rasterman) wrote: > > > On Tue, 1 Nov 2011 08:54:47 +0100 (CET) Vincent Torri <vto...@univ-evry.fr> > > said: > > > > does that work on wince? > > not tested, but it should: > > http://msdn.microsoft.com/en-us/library/aa908730.aspx > > I can tweak it a bit though, to give a nice error message if it fails > (both win32 and win ce) then this seems an adequate solution. :) > Vincent > > > > >> > >> hey > >> > >> about utf16 to utf8 conversion, can you try the function below ? If it > >> works, I commit it. > >> > >> Vincent > >> > >> > >> char * > >> evil_utf16_to_utf8(const wchar_t *text16) > >> { > >> char *text8; > >> DWORD flag = 0; > >> int size8; > >> > >> if ((!text16) || (*text16 == L'\0')) > >> return NULL; > >> > >> #if _WIN32_WINNT >= 0x0600 > >> flag = WC_ERR_INVALID_CHARS;; > >> #endif > >> > >> size8 = WideCharToMultiByte(CP_UTF8, flag, text16, -1, NULL, 0, NULL, > >> NULL); if (size8 == 0) > >> return NULL; > >> > >> text8 = (char*)malloc(size8 * sizeof(char)); > >> if (!text8) > >> return NULL; > >> > >> size8 = WideCharToMultiByte(CP_UTF8, flag, text16, -1, text8, size8, > >> NULL, NULL); if (size8 == 0) > >> return NULL; > >> > >> return text8; > >> } > >> > >> ------------------------------------------------------------------------------ > >> RSA® Conference 2012 > >> Save $700 by Nov 18 > >> Register now > >> http://p.sf.net/sfu/rsa-sfdev2dev1 > >> _______________________________________________ > >> enlightenment-devel mailing list > >> enlightenment-devel@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > >> > > > > > > -- > > ------------- Codito, ergo sum - "I code, therefore I am" -------------- > > The Rasterman (Carsten Haitzler) ras...@rasterman.com > > > > > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel