Board index » delphi » Ascii prob

Ascii prob

Hi all,

I've got a little problem with my app (cashregister) that sends strings to
devices as a printer an a customer display etc.
I use D5 standard (UK)

Problem:
When I send a string containing the character for example, I see that it
comes out as T on the printer and and the display.
= ascii code 130, but in Delphi it appears to be ascii code 232.

I want to print correctly 'pat' for example, but it comes out as 'patT'

Why is this? Is Delphi using another (american) ascii table?
Can I change something in the Delphi (UK) settings so that the correct ascii
codes for me are used?
I'm already working on a conversion routine to convert all these special
symbols for each string that I send to a printer...
But maybe it is not necessary. Any suggestions are welcome.

I kinda feel stupid to ask this... I've the impression that I missed
something.

Thanx
Dave

 

Re:Ascii prob


Check your printer manual, you may find that you have several character sets
or code pages to select from. My OKI Dot matrix has a dozen different ones.
Fortunately it is only used on our accounting system the problem doesn't
arise.

kind regards

Jerome Davies

Quote
"Dirckx Dave" <dirc...@belgacom.net> wrote in message

news:3b4b076a$0$25482$ba620e4c@news.skynet.be...
Quote
> Hi all,

> I've got a little problem with my app (cashregister) that sends strings to
> devices as a printer an a customer display etc.
> I use D5 standard (UK)

> Problem:
> When I send a string containing the character for example, I see that it
> comes out as T on the printer and and the display.
> = ascii code 130, but in Delphi it appears to be ascii code 232.

> I want to print correctly 'pat' for example, but it comes out as 'patT'

> Why is this? Is Delphi using another (american) ascii table?
> Can I change something in the Delphi (UK) settings so that the correct
ascii
> codes for me are used?
> I'm already working on a conversion routine to convert all these special
> symbols for each string that I send to a printer...
> But maybe it is not necessary. Any suggestions are welcome.

> I kinda feel stupid to ask this... I've the impression that I missed
> something.

> Thanx
> Dave

Re:Ascii prob


I asked my teacher about that some months ago and he told me ascii tables
are respected only for the basic symbols, and the codes for others (like ,
?, etc....) can be very different from the "official" ascii table's ones.
Apart from testing each code independently and establishing your own ascii
table, i can't see any solution! Moreover, i dun't know why and how such a
plurality in ascii tables can be possible.

/rocco

--
http://www.matholympiads.fr.st

Dirckx Dave a crit dans le message
<3b4b076a$0$25482$ba620...@news.skynet.be>...

Quote
>Hi all,

>I've got a little problem with my app (cashregister) that sends strings to
>devices as a printer an a customer display etc.
>I use D5 standard (UK)

>Problem:
>When I send a string containing the character for example, I see that it
>comes out as T on the printer and and the display.
> = ascii code 130, but in Delphi it appears to be ascii code 232.

>I want to print correctly 'pat' for example, but it comes out as 'patT'

>Why is this? Is Delphi using another (american) ascii table?
>Can I change something in the Delphi (UK) settings so that the correct
ascii
>codes for me are used?
>I'm already working on a conversion routine to convert all these special
>symbols for each string that I send to a printer...
>But maybe it is not necessary. Any suggestions are welcome.

>I kinda feel stupid to ask this... I've the impression that I missed
>something.

>Thanx
>Dave

Re:Ascii prob


Your problem is one of so called CodePages Windows uses codepage 1252
(Western europe) and your printer probably uses 850 (DOS / OEM)

Use CharToOEM to convert your string to a OEM type sting. Keep in mind this
is a 'smart' kind of API call it will translate acording to specifiv windows
settings. If you look it up in the helpfile you'll find related funtions to
translate between CodePages.

--
Greetings,

Ivar Snaaijer
_______________________________
Iris Huisstijlautomatisering BV
P.O.Box 355
2950AJ  Alblasserdam
The Netherlands

Tel: +31 78 699 29 00
Fax: +31 78 699 09 81
http://www.iris-hsa.nl
mailto:I.Snaai...@iris-hsa.nl
"Dirckx Dave" <dirc...@belgacom.net> schreef in bericht
news:3b4b076a$0$25482$ba620e4c@news.skynet.be...

Quote
> Hi all,

> I've got a little problem with my app (cashregister) that sends strings to
> devices as a printer an a customer display etc.
> I use D5 standard (UK)

> Problem:
> When I send a string containing the character for example, I see that it
> comes out as T on the printer and and the display.
> = ascii code 130, but in Delphi it appears to be ascii code 232.

> I want to print correctly 'pat' for example, but it comes out as 'patT'

> Why is this? Is Delphi using another (american) ascii table?
> Can I change something in the Delphi (UK) settings so that the correct
ascii
> codes for me are used?
> I'm already working on a conversion routine to convert all these special
> symbols for each string that I send to a printer...
> But maybe it is not necessary. Any suggestions are welcome.

> I kinda feel stupid to ask this... I've the impression that I missed
> something.

> Thanx
> Dave

Re:Ascii prob


Hello Dirckx Dave from Pierre in Morvan, France

The sample on you gave indiocates your printer is just configured with OLD DOS
ascii codes !
The Delphi and Windows apps are now using the as normalised since Windows took
over DOS !

So you have to transcode the ascci codes for a DOS operating system and it's not
simple as all was re organized in latest DOS and Win editions !

Would be best to either search a new PROM for your printer, an emulation in it's
setup for a Win device or to change for a new model !
This problem is also with old TXT formats and even DOC files from Word for DOS
when imported in new Win text editors !

Hope it will help ..

 *****************
 *****************
 Pierre BONNARD  pierrebonn...@online.fr
 http://pierrebonnard.online.fr/index.htm
 A part of MORVAN in France for sabots, handicrafts and wood works
 Where to find informations and help on Generic Cadd, Visual Cadd
 *****************

Quote

> Hi all,

> I've got a little problem with my app (cashregister) that sends strings to
> devices as a printer an a customer display etc.
> I use D5 standard (UK)

> Problem:
> When I send a string containing the character for example, I see that it
> comes out as T on the printer and and the display.
> = ascii code 130, but in Delphi it appears to be ascii code 232.

> I want to print correctly 'pat' for example, but it comes out as 'patT'

> Why is this? Is Delphi using another (american) ascii table?
> Can I change something in the Delphi (UK) settings so that the correct ascii
> codes for me are used?
> I'm already working on a conversion routine to convert all these special
> symbols for each string that I send to a printer...
> But maybe it is not necessary. Any suggestions are welcome.

> I kinda feel stupid to ask this... I've the impression that I missed
> something.

> Thanx
> Dave

Other Threads