Sign in Join

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

Mailing lists / fpc-pascal / 2006-07

national support

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Friš Martin Mgr

I am enthusiastic user of Free Pascal. I want ask a question, if there in Free Pascal exist the support for national environment. In czech there are letters with diacritics. They are not displayed correctly on the screen and on the printer. In Windows there is code page 1250 for these signs. Is there something in Free pascal?

Martin Fris

Tomas Hajny
to Friš Martin Mgr
Fria Martin Mgr wrote 5 lines
I am enthusiastic user of Free Pascal. I want ask a question, if there in Free Pascal exist the support for national environment. In czech there are letters with diacritics. They are not displayed correctly on the screen and on the printer. In Windows there is code page 1250 for these signs. Is there something in Free pascal?

I'm afraid that you'll have to provide little bit more information about your problem. FPC as such certainly shouldn't prevent characters supported on your platform to be displayed correctly. A simple example program would be nice.

Important points to be aware of:

- Under MS Windows, different codepages might be used by default for GUI applications ({APPTYPE GUI}) and console programs ({APPTYPE CONSOLE}).

- The particular behaviour for console programs differs for different versions of MS Windows (in particular, all W9x based versions + WinNT 4.0 differs from Win2k and above).

- Behaviour of FPC programs depends on whether you use single byte storage (like ShortString and AnsiString), or WideString.

- Some units (e.g. Crt) may affect behaviour of console output.

Tomas

Friš Martin Mgr

I give additional details. I write programs for mathematical linguistics. Especially program for frequency dictionary of chosen text. I write text to the editor. The text is in Czech. It displays correctly in editor window , i.e. with diacritics. Then follows transformation into words. In program for frequency diactionary, which contains binary search I have usual read and write statements. When I send the result to the printer with write it is displayed incorrectly on the print output - the diacritics. I am working under Windows |X|P.

What other details should I give for somebody to give me advice.

Martin Fris

Earlier message 11 lines
-----Original Message----- From: On Behalf Of Friš Martin Mgr Sent: Monday, July 10, 2006 2:21 PM To: Subject: [fpc-pascal] national support I am enthusiastic user of Free Pascal. I want ask a question, if there in Free Pascal exist the support for national environment. In czech there are letters with diacritics. They are not displayed correctly on the screen and on the printer. In Windows there is code page 1250 for these signs. Is there something in Free pascal? Martin Fris
Michael Van Canneyt
to Friš Martin Mgr
Friš Martin Mgr wrote 7 lines
I give additional details. I write programs for mathematical linguistics. Especially program for frequency dictionary of chosen text. I write text to the editor. The text is in Czech. It displays correctly in editor window , i.e. with diacritics. Then follows transformation into words. In program for frequency diactionary, which contains binary search I have usual read and write statements. When I send the result to the printer with write it is displayed incorrectly on the print output - the diacritics. I am working under Windows |X|P.

You cannot do that; The screen is in codepage 1250 (or 1251), but the codepage of the printer is most likely 850 or so (whatever plain ascii is). What you can try to do is to use the windows AnsiToOEMChar routine to convert the windows codepage to something that the printer understands.

Michael.

Tomas Hajny
to Friš Martin Mgr: I give additional details. I write programs for mathematical linguistics. Especially…
Fria Martin Mgr wrote 10 lines
I give additional details. I write programs for mathematical linguistics. Especially program for frequency dictionary of chosen text. I write text to the editor. The text is in Czech. It displays correctly in editor window , i.e. with diacritics. Then follows transformation into words. In program for frequency diactionary, which contains binary search I have usual read and write statements. When I send the result to the printer with write it is displayed incorrectly on the print output - the diacritics. I am working under Windows |X|P. What other details should I give for somebody to give me advice.

I guess this might be enough for somebody to try - I personally have absolutely no idea what kind of charset is used/expected when printing via Write(Ln) to Lst under Windows, but this shouldn't be difficult to check? Do I understand it correctly that the screen output is OK now (as opposed to your original post)?

Tomas

Show quoted text 17 lines
-----Original Message----- From: On Behalf Of Fria Martin Mgr Sent: Monday, July 10, 2006 2:21 PM To: Subject: [fpc-pascal] national support I am enthusiastic user of Free Pascal. I want ask a question, if there in Free Pascal exist the support for national environment. In czech there are letters with diacritics. They are not displayed correctly on the screen and on the printer. In Windows there is code page 1250 for these signs. Is there something in Free pascal? Martin Fris
Пётр Косаревский
Show quoted text 8 lines
> What other details should I give for somebody to give me advice. I guess this might be enough for somebody to try - I personally have absolutely no idea what kind of charset is used/expected when printing via Write(Ln) to Lst under Windows, but this shouldn't be difficult to check? Do I understand it correctly that the screen output is OK now (as opposed to your original post)? Tomas

Some of these matters were discussed before in maillist related to "crt garbles writeln output" ( is one of the messages).

There was a patch for that (not this) problem from Maxim Ganetsky, which can help to understand things.

DarekM
to Friš Martin Mgr: I give additional details. I write programs for mathematical linguistics. Especially…

Friš Martin Mgr napisał(a):

Show quoted text 30 lines
I give additional details. I write programs for mathematical linguistics. Especially program for frequency dictionary of chosen text. I write text to the editor. The text is in Czech. It displays correctly in editor window , i.e. with diacritics. Then follows transformation into words. In program for frequency diactionary, which contains binary search I have usual read and write statements. When I send the result to the printer with write it is displayed incorrectly on the print output – the diacritics. I am working under Windows |X|P. What other details should I give for somebody to give me advice. Martin Fris -----Original Message----- *From:* *On Behalf Of *Friš Martin Mgr *Sent:* Monday, July 10, 2006 2:21 PM *To:* *Subject:* [fpc-pascal] national support I am enthusiastic user of Free Pascal. I want ask a question, if there in Free Pascal exist the support for national environment. In czech there are letters with diacritics. They are not displayed correctly on the screen and on the printer. In Windows there is code page 1250 for these signs. Is there something in Free pascal? Martin Fris

Hi
Printing diactrics not depend on FPC only on system and choose code page of You.
You can write on printer with the same like on screen. Printer has the same canvas. But when You choose font You have to change code page. to
1250. You can print also in text mode, but then You have to change code page manual (its depend on printer). Some times You have to convert text form one code page to another (f.e from 8859-2 to 1250 or UTF-8) Send which method You need, and sample code.

Darek

Show quoted text 5 lines
------------------------------------------------------------------------ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Tomas Hajny
Michael Van Canneyt wrote 14 lines
On Wed, 26 Jul 2006, Friš Martin Mgr wrote: > I give additional details. I write programs for mathematical linguistics. > Especially program for frequency dictionary of chosen text. > I write text to the editor. The text is in Czech. It displays correctly in editor window , > i.e. with diacritics. Then follows transformation into words. In program for frequency > diactionary, which contains binary search I have usual read and write statements. > When I send the result to the printer with write it is displayed incorrectly on the > print output - the diacritics. I am working under Windows |X|P. You cannot do that; The screen is in codepage 1250 (or 1251), but the codepage of the printer is most likely 850 or so (whatever plain ascii is). What you can try to do is to use the windows AnsiToOEMChar routine to convert the windows codepage to something that the printer understands.

"Something that the printer understands" is the
important part. It might be that it doesn't
support the characters with diacritics by default
and that you need to switch to another character
set using some control code first (where the
control code would be most likely specific to the
particular printer or at least "category")...

Tomas