Solved

Unicode file to Editbox

Posted on 2002-06-10
3
312 Views
Last Modified: 2010-04-04
I'm trying to read a unicode file (with Thai text) and display this in a control on the form like an Editbox.

I can read the data into a buffer (array of bytes) but don't know how to convert this to a proper string for the Editbox.

Some details, as I believe is standard with a unicode file it starts with bytes "FF FE" what do they mean, can I just skip them, or is this the codepage?

I assume there is some windows function to convert the array of bytes I read to a proper string. But what is it called and how do I use this. I tried OemToChar and MultiByteToWideChar and back again, but didn't work, or didn't know how to use it.

Regards, Nico
0
Comment
Question by:NicoLaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 400 total points
ID: 7067120
FFFE is the "BOM". It is a marker to tell the bytesex of the Unicode chars. That is which byte comes first for a two byte Unicode char.

Normal VCL components cannot show USB.
Have a look at http://www.delphi-unicode.net
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7067124
"USB" Tsk, i meant Unicode.
0
 
LVL 4

Author Comment

by:NicoLaan
ID: 8764573
I guess it's about time to close this qeustion.

Your answer is not exactly what I was looking for, but it did send me in the right direction. Also I guess it WAS an answer to the actual question.

I've delayed this project for a while because other priorities came up and also your answer made me think things where a bit more complicated than I first hoped.

Recently I contiunued again with this and the solution I ended up with is this, I downloaded from another site a number of Delphi components supporting unicode.
http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls.htm
Among them also database controls.
So now I'm gonna be using a simple database (consisting of only some DBF files most likely) and with them I'll be trying to make the program. I might still return to the site you gave me since it has a lot of unicode conversion funtions and I might still need those.

I'll try to post back more comments on progress when I get there.

Thanks and kind regards, Nico
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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