Solved

Unicode file to Editbox

Posted on 2002-06-10
3
306 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now