Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5843991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:13:55+00:00 2026-05-22T12:13:55+00:00

procedure p; var f:TextFile; oemst:OemString;///declared as OemString = Type AnsiString(CP_OEMCP); begin AssignFile(f,fileName); reset(f); read(f,oemSt);

  • 0
procedure p;
var 
  f:TextFile;
  oemst:OemString;///declared as   OemString = Type AnsiString(CP_OEMCP);
begin
  AssignFile(f,fileName);
  reset(f);
  read(f,oemSt);
  ShowMessage(oemst);
end;

In order to see within the show message the oemst in the proper encoding, one needs to declare:
setcodepage(oemst,862,false);

How is it possible to read from an oem file, and make sure the compiler show it correctly in oem encoding?

update:
Working with Oem is a MUst, as I don’t specify this old interface.
working with readln assign file is part of the old code, and I rather have a solution using the old methods as it requires less work and testing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:13:56+00:00Added an answer on May 22, 2026 at 12:13 pm

    In D2009 and up you are usually better off not using the old Pascal file methods like assignfile, read(ln) and write(ln) as they do not support Unicode. And everybody will advice you to use streams instead. In this case you may actually be better of using the old way because it doesn’t understand Unicode.

    While you are setting the code page correctly, what I think you need to do to get this to work for you, is set the console’s code page using SetConsoleCP. That is a Windows API call which is declared in the Windows unit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already read up about passing by reference and so procedure test(var x:integer); begin
procedure ListMembers; var Member, lMembers: string; lengthOfMember: Longint; begin Writeln; Writeln; Reset(FileA); //Only need
procedure TMainForm.FormDestroy(Sender: TObject); var Registry: TRegistry; begin Registry := TRegistry.Create; try Registry.RootKey := HKEY_CURRENT_USER;
what is wrong there? procedure TForm1.VCLHelpClick(Sender: TObject); var Ctrl : TWinControl; begin Ctrl :=
I have a callback procedure: type TInitCallback = procedure (var Data: Pointer); The idea
Here's is my code: type TNav = class(TPanel) private procedure CMMouseEnter(var AMsg: TMessage); message
Using D2010, I'd like to do something like this: procedure SizeArray(var aArr: array of
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
I want to do the following,but I get errors: procedure JumpToCodeCave(CurrentLocation:DWORD;Destination:Pointer;out_JmpBack:Pointer); var calc:DWORD; jmppatch:Array[0..3]
On Delphi 2009, on a new VCL project: procedure TForm1.FormCreate(Sender: TObject); var Handle: THandle;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.