?
Solved

UTF8 results from Zeos

Posted on 2006-05-14
6
Medium Priority
?
2,205 Views
Last Modified: 2008-01-09
I need read UTF-8 records from MySQL database using Zeos library (+ TNTstringgrid =unicode stringgrid), but every result looks as ASCII.

Can you tell me, how to set it right?
0
Comment
Question by:LadinT
  • 3
  • 3
6 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 16676999
1) make sure that the fields in mysql tables are of type utf-8
2) how do you read the records? what components do you use? are those components utf-8 (unicode) enabled?
3) how do you pass the records from the components to the zeos components?
0
 

Author Comment

by:LadinT
ID: 16677056
1) If work with this tables in PHP (some years :-) ), i can write and read it right
2) I use Zeos library, but i don't know if it is Unicode enabled, i think it is. TNTcomponents are unicode enabled.

I have set ZConnection Properties set to codepage=utf8
Non-ASCII character are displayed as two-characters, not as '?'

I only want describe any example with Zeos, where i can see result in UTF-8


0
 
LVL 28

Expert Comment

by:2266180
ID: 16678781
I never worked with zeos, but I suggest looking at the way you read the records and saving the output to a file. then you can view the file and see if zeos indeed gets the records correctly. if it does, and tnt doesn't show it right, then you found your problem. if it doesn't read them right, then again you found your problem :)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:LadinT
ID: 16726129
If i save it to file, it is correct.

Output from zeos is as string only, other characters are displayed as sequence 8-bit chars.  
Can you send me some example for conversion of this string to utf8? Simple conversion is bad, i need convert it as stream... maybe...

I cannot find something useful...

Thank You.
0
 
LVL 28

Accepted Solution

by:
2266180 earned 600 total points
ID: 16726223
it's 2:35 am here and I was going to bed :) but I'll tell you what functions to try. if you can't make it work, I'll give you tomorrow a working example to convert utf8 to string and back. also put some of those strings you have trouble with in a file and base64 encode it and paste it here so that  I will have some valid data to test with (there are plenty of base63 encoders out there (totalcommander also has built int)

so Utf8ToAnsi and AnsoToUtf8 ar the 2 conversion functions.
considering the output you use, you might need to first convert from unicode to utf8 (or directly to string) using UnicodeToUtf8/Utf8Encode or WideCharToString.
0
 

Author Comment

by:LadinT
ID: 16726788
It is OK, UTF8decode is my new friend.

Thank You
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question