none
Conversion by MultiByteToWideChar RRS feed

  • Question

  • Hi all,

    WinCE600R3 iMX51.

    I'm compiling a static lib of the Berkeley_DB: on an old image the library gave me no error.

    On my current image i receive the error 87: debugging the problem i found that the error was generated by the macro:

    #define	TO_TSTRING(dbenv, s, ts, ret) do {				\
    		int __len = (int)strlen(s) + 1;				\
    		ts = NULL;						\
    		if ((ret = __os_malloc((dbenv),				\
    		    __len * sizeof(_TCHAR), &(ts))) == 0 &&		\
    		    MultiByteToWideChar(CP_UTF8, 0,			\
    		    (s), -1, (ts), __len) == 0)				\
    			ret = __os_posix_err(__os_get_syserr());	\
    	} while (0)

    If i change 'CP_UTF8' to 'CP_ACP' everything is OK.

    Any idea ???


    SteMMo

    Saturday, September 8, 2012 3:52 PM

Answers

  • Setting SYSGEN_MLAN has the effect of setting other environment variables/components which has to do with localization (one example SYSGEN_CORELOC) which may explain that behaviour

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    • Marked as answer by SteMMo Monday, September 10, 2012 10:52 AM
    Monday, September 10, 2012 9:12 AM

All replies

  • Hi SteMMo,

    Can you give more information about the error that you see?

    Preferably, please show a snippet of the build log near the error.

    Ilan.

    Sunday, September 9, 2012 2:08 PM
  • Hi,

    i simply wrote a little app to test the library (open, read, close) and, when i open the db, i receive the return value 87 intead of 0.

    I don't understand why in a previous WinCE image i don't receive the same error: my guess is a different set of variables in the compiler environment and i'd like to find which.


    SteMMo

    Monday, September 10, 2012 7:53 AM
  • Now i've found that the old image contained iesample and when I check the item the framework also selects the symbol SYSGEN_MLANG.

    Is this constant the responsible of the UTF8 code page ????


    SteMMo

    Monday, September 10, 2012 8:22 AM
  • Setting SYSGEN_MLAN has the effect of setting other environment variables/components which has to do with localization (one example SYSGEN_CORELOC) which may explain that behaviour

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    • Marked as answer by SteMMo Monday, September 10, 2012 10:52 AM
    Monday, September 10, 2012 9:12 AM
  • I modified the 'Locale sevices' selection from SYSGEN_LOCUSA to SYSGEN_CORELOC and now the image seems to be ok.


    SteMMo

    Monday, September 10, 2012 10:52 AM