Solved

DOS-WINDOWS International Character Incompability

Posted on 1997-10-08
3
186 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
[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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 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