Solved

Unicode file to Editbox

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process Javascript errors with Delphi TWebBrowser 1 210
Dev Express grid collapse 2 48
CheckListBox usage 3 83
Firemonkey how to swip panel with finger tap 1 23
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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