Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with national diacritics letters MySQL-VFP9
Message
From
05/02/2007 13:39:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
05/02/2007 05:46:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Miscellaneous
Thread ID:
01192316
Message ID:
01192516
Views:
26
>I got by download last ODBC driver for MySQL (ver. 3.51.12) and at first sight it was functional. Let me explain problem: I have installed MySQL 5.0 database and tables under utf8 coding. Adding, browsing and updating this database I made by php-scripts (coding of php-pages is also utf8) and everything is going fine: all national characters (Latin2 family, codepage 1250, Croatian) is appearing properly in the browser and in the database. Now I need sometime to view, put or change some records from the VFP in this MySQL database. When I connected from VFP to this database/table by ODBC using remote view data appeared and was possible to update and insert from VFP's form only if Textbox contains only English alphabet or numbers. But if I put just one or few national (diacritic) letters (like ČčĆćĐ𩹮ž) in Textbox of forms then VFP refuse to update or insert record into MySQL like I clicked on Cancel button! VFP is under Central European and font of forms is
> unable to change in other type. Already inserted data in MySQL appeared in the VFP's form with '?' instead adequate letters. Is there some solution good for both access to MySQL database, by php and from VFP and to keep proper view of data on both places? Thanks a lot in advance.

This is the code I use on each SQL statement before I submit it:
*[2006/12/17 10:09:13] dragan - konverzija za UTF-8, samo latinica
convFrom="ŽŠĐČĆžšđčć"
convtable= "C5BDC5A0C490C48CC486C5BEC5A1C491C48DC487"
FOR i=1 TO LEN(convFrom)
cut=SUBSTR(convtable, (i-1)*4+1,4)
rpl=STRCONV(cut,16)
lcsql=STRTRAN(lcsql, SUBSTR(convFrom,i,1), rpl)

ENDFOR

Where lcSQL is the SQL statement. Haven't bothered with the data I get from the server (yet), because I didn't need them. This was just to get the VFP data into UTF8 tables properly, so that šđčćž would display right on PHP pages. I actually don't need to see those data back in VFP at all. You may use this as a base for reverse conversion - just reverse the last two parameters in the STRTRAN().

(sorry for no formatting, but if I put the PRE tag, the yu-chars come up as HTML entities)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform