Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-06

question about changing default ASCII table in the fpc 2.2.0 IDE

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Noel and Marie

Hello,

I would like to print a square root symbol using write(chr(251)); as I could before SP3 for XP was installed on my PC.

Currently am getting a superscript 1 rather than the square root symbol from write(chr(251)).

I've tried the following kind suggestions of Tomas Hajny, unfortunately without success:

1. In a command shell I entered
CHCP 437 and then ran the program

2. Modified the source code to include the Windows unit and added line setConsoleOutputCP(437);,
compiled and then ran the program.

I examined the registry settings in directory Codepage. Name Data
(default ) (value not set)
...
ACP 1252
MACCP 10000
OEMCP 850
OEMHAL vgaoem.fon

Changed OEMCP to 437 and got an accented 'u'. Then restored the system.

I wonder if anyone can suggest a solution to the problem.

Noel Haydon

Reply by email

Michael Van Canneyt
to Noel and Marie
Noel and Marie wrote 32 lines
Hello, I would like to print a square root symbol using write(chr(251)); as I could before SP3 for XP was installed on my PC. Currently am getting a superscript 1 rather than the square root symbol from write(chr(251)). I've tried the following kind suggestions of Tomas Hajny, unfortunately without success: 1. In a command shell I entered CHCP 437 and then ran the program 2. Modified the source code to include the Windows unit and added line setConsoleOutputCP(437);, compiled and then ran the program. I examined the registry settings in directory Codepage. Name Data (default ) (value not set) ... ACP 1252 MACCP 10000 OEMCP 850 OEMHAL vgaoem.fon Changed OEMCP to 437 and got an accented 'u'. Then restored the system. I wonder if anyone can suggest a solution to the problem.

Have you tried simply using a different font for the console ?

Michael.

Reply by email

Tomas Hajny
to Noel and Marie: I would like to print a square root symbol using write(chr(251)); as I could before SP3…
Noel and Marie wrote 33 lines
Hello, I would like to print a square root symbol using write(chr(251)); as I could before SP3 for XP was installed on my PC. Currently am getting a superscript 1 rather than the square root symbol from write(chr(251)). I've tried the following kind suggestions of Tomas Hajny, unfortunately without success: 1. In a command shell I entered CHCP 437 and then ran the program 2. Modified the source code to include the Windows unit and added line setConsoleOutputCP(437);, compiled and then ran the program. I examined the registry settings in directory Codepage. Name Data (default ) (value not set) ... ACP 1252 MACCP 10000 OEMCP 850 OEMHAL vgaoem.fon Changed OEMCP to 437 and got an accented 'u'. Then restored the system. I wonder if anyone can suggest a solution to the problem.

I still intend to have a look at it (as promised previously), just had no time for that (if noone else provides answer till then).

Tomas

Reply by email

Noel and Marie
to Michael Van Canneyt: Have you tried simply using a different font for the console ? Michael.

Thanks Michael for the comment but that is what I am trying to do. I have played with Properties->Font in a command shell (cmd.exe) without luck

Earlier message 51 lines
----- Original Message ----- From: "Michael Van Canneyt" To: "FPC-Pascal users discussions" Sent: Thursday, June 24, 2010 4:28 PM Subject: Re: [fpc-pascal] question about changing default ASCII table in thefpc 2.2.0 IDE > > > On Thu, 24 Jun 2010, Noel and Marie wrote: > >> Hello, >> >> I would like to print a square root symbol using write(chr(251)); as I >> could before SP3 for XP was installed on my PC. >> >> Currently am getting a superscript 1 rather than the square root symbol >> from write(chr(251)). >> >> I've tried the following kind suggestions of Tomas Hajny, unfortunately >> without success: >> >> 1. In a command shell I entered >> CHCP 437 and then ran the program >> >> 2. Modified the source code to include the Windows unit and added line >> setConsoleOutputCP(437);, >> compiled and then ran the program. >> >> >> I examined the registry settings in directory Codepage. >> Name Data >> (default ) (value not set) >> ... >> ACP 1252 >> MACCP 10000 >> OEMCP 850 >> OEMHAL vgaoem.fon >> >> Changed OEMCP to 437 and got an accented 'u'. Then restored >> the system. >> >> I wonder if anyone can suggest a solution to the problem. > > Have you tried simply using a different font for the console ? > > Michael. > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Noel and Marie
to Tomas Hajny: I still intend to have a look at it (as promised previously), just had no time for that…

Thanks Tomas. I didn't see your promise to look at the problem.

I have just relied on email replies for comments etc. How do I look at all comments, other questions, etc on the Web?

Noel

Earlier message 49 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Thursday, June 24, 2010 11:59 PM Subject: Re: [fpc-pascal] question about changing default ASCII table in the fpc 2.2.0 IDE On Thu, June 24, 2010 06:41, Noel and Marie wrote: > Hello, > > I would like to print a square root symbol using write(chr(251)); as I > could before SP3 for XP was installed on my PC. > > Currently am getting a superscript 1 rather than the square root symbol > from > write(chr(251)). > > I've tried the following kind suggestions of Tomas Hajny, unfortunately > without success: > > 1. In a command shell I entered > CHCP 437 and then ran the program > > 2. Modified the source code to include the Windows unit and added line > setConsoleOutputCP(437);, > compiled and then ran the program. > > > I examined the registry settings in directory Codepage. > Name Data > (default ) (value not set) > ... > ACP 1252 > MACCP 10000 > OEMCP 850 > OEMHAL vgaoem.fon > > Changed OEMCP to 437 and got an accented 'u'. Then restored > the system. > > I wonder if anyone can suggest a solution to the problem. I still intend to have a look at it (as promised previously), just had no time for that (if noone else provides answer till then). Tomas

Reply by email

Tomas Hajny
to Noel and Marie

On 25 Jun 10, at 8:07, Noel and Marie wrote:

Hi Noel,

Thanks Tomas. I didn't see your promise to look at the problem.

Sorry, it took somewhat longer, but the results are here:

1) It works as expected if _not_ using unit Crt.

2) There is a bug in implementation of unit Crt for Windows. This bug stems from May 2006 already and it was a result of a patch from Maxim Ganetsky trying to fix bug #6785
(http://bugs.freepascal.org/view.php?id=6785). Since that patch, all output with unit Crt uses the so called ANSI code page under Windows which is IMHO wrong. I've added a comment to bug #6785 and filed a new bug report (http://bugs.freepascal.org/view.php?id=16846) - you may want to monitor that one in order to be notified when it gets fixed.

Until the bug is fixed, there are several possible solutions for you, e.g.:

- You may comment line 699 (and preferably also line 743) in your local copy of rtl/win/crt.pp (trunk version from SVN) and recompile RTL (and packages). That isn't a complete fix, but it should probably be sufficient for your needs.

- If you only need to output this one particular character, you may do so using the particular Win32 API directly. Admittedly not very nice and certainly not portable, but at least a possible workaround.

- If you don't need unit Crt, you may simply remove it from your uses clause.

I have just relied on email replies for comments etc. How do I look at all comments, other questions, etc on the Web?

Sorry, I'm not sure if I understand this question. Do you refer to an archive of this mailing list? If so, you can find a link on the FPC WWW pages (under Mailing lists).

Hope this helps

Tomas

Show quoted text 47 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Thursday, June 24, 2010 11:59 PM Subject: Re: [fpc-pascal] question about changing default ASCII table in the fpc 2.2.0 IDE On Thu, June 24, 2010 06:41, Noel and Marie wrote: > Hello, > > I would like to print a square root symbol using write(chr(251)); as I > could before SP3 for XP was installed on my PC. > > Currently am getting a superscript 1 rather than the square root symbol > from > write(chr(251)). > > I've tried the following kind suggestions of Tomas Hajny, unfortunately > without success: > > 1. In a command shell I entered > CHCP 437 and then ran the program > > 2. Modified the source code to include the Windows unit and added line > setConsoleOutputCP(437);, > compiled and then ran the program. > > > I examined the registry settings in directory Codepage. > Name Data > (default ) (value not set) > ... > ACP 1252 > MACCP 10000 > OEMCP 850 > OEMHAL vgaoem.fon > > Changed OEMCP to 437 and got an accented 'u'. Then restored > the system. > > I wonder if anyone can suggest a solution to the problem. I still intend to have a look at it (as promised previously), just had no time for that (if noone else provides answer till then). Tomas

Reply by email

Noel and Marie
to Tomas Hajny

Thank you Tomas for tracking down the bug and filing the bug report. It was much appreciated.

Cheers,
Noel

Earlier message 113 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Cc: ; "Noel and Marie" Sent: Tuesday, July 06, 2010 5:32 AM Subject: Re: [fpc-pascal] question about changing default ASCII table in thefpc 2.2.0 IDE > On 25 Jun 10, at 8:07, Noel and Marie wrote: > > > Hi Noel, > >> Thanks Tomas. I didn't see your promise to look at the problem. > > Sorry, it took somewhat longer, but the results are here: > > 1) It works as expected if _not_ using unit Crt. > > 2) There is a bug in implementation of unit Crt for Windows. This bug > stems from May 2006 already and it was a result of a patch from Maxim > Ganetsky trying to fix bug #6785 > (http://bugs.freepascal.org/view.php?id=6785). Since that patch, all > output with unit Crt uses the so called ANSI code page under Windows > which is IMHO wrong. I've added a comment to bug #6785 and filed a > new bug report (http://bugs.freepascal.org/view.php?id=16846) - you > may want to monitor that one in order to be notified when it gets > fixed. > > Until the bug is fixed, there are several possible solutions for you, > e.g.: > > - You may comment line 699 (and preferably also line 743) in your > local copy of rtl/win/crt.pp (trunk version from SVN) and recompile > RTL (and packages). That isn't a complete fix, but it should probably > be sufficient for your needs. > > - If you only need to output this one particular character, you may > do so using the particular Win32 API directly. Admittedly not very > nice and certainly not portable, but at least a possible workaround. > > - If you don't need unit Crt, you may simply remove it from your uses > clause. > > >> I have just relied on email replies for comments etc. How do I look at >> all >> comments, other questions, etc on the Web? > > Sorry, I'm not sure if I understand this question. Do you refer to an > archive of this mailing list? If so, you can find a link on the FPC > WWW pages (under Mailing lists). > > Hope this helps > > Tomas > > >> ----- Original Message ----- >> From: "Tomas Hajny" >> To: "FPC-Pascal users discussions" >> Sent: Thursday, June 24, 2010 11:59 PM >> Subject: Re: [fpc-pascal] question about changing default ASCII table in >> the >> fpc 2.2.0 IDE >> >> >> On Thu, June 24, 2010 06:41, Noel and Marie wrote: >> > Hello, >> > >> > I would like to print a square root symbol using write(chr(251)); as I >> > could before SP3 for XP was installed on my PC. >> > >> > Currently am getting a superscript 1 rather than the square root symbol >> > from >> > write(chr(251)). >> > >> > I've tried the following kind suggestions of Tomas Hajny, unfortunately >> > without success: >> > >> > 1. In a command shell I entered >> > CHCP 437 and then ran the program >> > >> > 2. Modified the source code to include the Windows unit and added line >> > setConsoleOutputCP(437);, >> > compiled and then ran the program. >> > >> > >> > I examined the registry settings in directory Codepage. >> > Name Data >> > (default ) (value not set) >> > ... >> > ACP 1252 >> > MACCP 10000 >> > OEMCP 850 >> > OEMHAL vgaoem.fon >> > >> > Changed OEMCP to 437 and got an accented 'u'. Then >> > restored >> > the system. >> > >> > I wonder if anyone can suggest a solution to the problem. >> >> I still intend to have a look at it (as promised previously), just had no >> time for that (if noone else provides answer till then). >> >> Tomas > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal >

Reply by email