>G'day
>
>I try to save unicode data to Mysql Server by using :
>
>=SYS(3101,65001)
>=SYS(987, .F.)
>
>mName = STRCONV(THISFORM.olecontrol2.text,12)
>mName = CREATEBINARY(mName)
>
>
> SQLEXEC(m.lnConn, "INSERT INTO testunicode (name) VALUES (CAST(?mName AS CHAR(100) ))")
>
>
>But it seem the code cant work correctly.
>
>Any advise?
>
>Thank and regards in advance.
Perhaps if you first make it binary and then store a binary value into it? Or have a cursor with a binary (i.e. nocptrans) memo field and store the value in it and then insert straight from that cursor?
Also, seeing that you're using an olecontrol - perhaps the olecontrol2.text is already unicode and you converted it again? Check that in the debugger.
And see what's the character set of that field in your target table - is it unicode or perhaps utf-8? Then you'd have to have a strconv(strconv(value, 6), 2) (or 2 inside and 6 outside - don't remember exactly).