Hi, guys
I'm fixing some multi-language function for our application software, we use FoxPro 9.0 and SQL server.
For now, I can successfuly extract data from SQL, display it in FoxPro Form (using OLE object); or import data from Excel, then save it into SQL server (thanks to Rick Strahl, http://www.west-wind.com/presentations/foxunicode/foxunicode.asp). But then, I stuck. When I try to extract data from SQL, then export them to Excel, I always get a lot of strange mark instead of my Chinese, Japanese or Arabic data shown in SQL server. I've try to STRCONV() data to Unicode or UTF-8, it just not work. Following are how I convert data in FoxPro:
** when extract data out of SQL server, convert data into VarBinary first
SQLEXEC(nConn,"SELECT CAST(CAST(p_wname as nVarChar(4000)) AS VarBinary(8000)) AS p_wname FROM program ","temp")
**convert data into UTF-8
SELECT CAST(STRCONV(p_wname,10) AS M) p_wname FROM temp INTO CURSOR TFData
** After above steps, I can show multi-language data in form normally
** And if I want to save the data back to SQL, I need to ....
** Coonvert data back to Unicode then to VarBinary
SELECT CREATEBINARY(STRCONV(p_wname,12)) AS p_wname FROM temp INTO CURSOR TFData1
** then Convert data into nVarChar
SQLEXEC
(nConn, " INSERT INTO program (p_wname) VALUES (CAST( TFData1.p_wname as nVarChar(50)))")
So how can I show data normally when exporting to Excel
Thanks a lot.