Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unicode file to Editbox

Posted on 2002-06-10
3
Medium Priority
?
315 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 1600 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

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…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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