Solved

DOS-WINDOWS International Character Incompability

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

Independent Software Vendors: 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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

628 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