Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DOS-WINDOWS International Character Incompability

Posted on 1997-10-08
3
Medium Priority
?
201 Views
Last Modified: 2010-04-04
I want to save some text including characters like 'ðüöçþÝ'
to be read from DOS's Edýt program. If I save the text directly international char5acters above are not shown.
Is there a way to save them directly from the Delphi program?
 One Solution may be that to sent the document to WordPad or Excel,Word and by using the 'save as' command save it in DOS compatible.
0
Comment
Question by:erkan
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 50 total points
ID: 1347090
Hi,

You have to convert the text from windows characterset to DOS characterset. You can do this in Delphi by using the Win32-function CharToOEM (older AnsiToOEM).

/pivar
0
 

Author Comment

by:erkan
ID: 1347091
Can you send me a working example?
0
 
LVL 22

Expert Comment

by:pivar
ID: 1347092
Hi,

Here is a simple example, where the function takes the (ANSI) text in a memo component and converts it to a DOS-text in pStr using the CharToOem function. Then it saves the text to the file 'test.txt', ready to be viewed in EDIT.

/pivar

procedure TForm1.Button1Click(Sender: TObject);
var
  fs: TFileStream;
  pStr: PChar;
begin
  pStr := StrAlloc(Length(memo1.text) + 1);
  CharToOem(PChar(memo1.text),pStr);
  fs := TFileStream.Create('test.txt',fmCreate);
  fs.write(pStr^,StrLen(pStr));
  fs.Free;
  StrDispose(pStr);
end;
0

Featured Post

Industry Leaders: 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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

971 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