Solved

Unicode file to Editbox

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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