£ prints as character ù

greeshma

Member
Hi All,

Wheneve i prints £ , it comes as ù from printer.
So i thought the problem is with printer and i tried printing £ from a notepad through printer , but that succeeded printer output was £.

I think the problem is related to the unicode value. Below given is the piece of code i tried.
Please help me .


DEF VAR v-ans AS logi.
DEF VAR v-elite AS CHAR INIT "~E&k4S" NO-UNDO.
DEF stream report.

DEF VAR a AS CHAR INIT "rrrr£rr" .

SYSTEM-DIALOG PRINTER-SETUP
NUM-COPIES 1
UPDATE v-ans.
output stream report to PRINTER
paged page-size 1.
PUT STREAM report CONTROL v-elite.
put stream report a at 1.
output stream report close.

 

RealHeavyDude

Well-Known Member
How would the printer know that the data it is receiving is unicode? The notepad editor uses the Windows GUI code page defined by your locale setting and probably tells the printer so. Therefore you either need to tell the printer ( have a look in the printer manual how to specify the code page and put the control sequence at the beginning ) or you direct the output into a file with the corresponding -cpstream setting. That file will then contain the corresponding non-printable telling the printer that it's unicode.

But all that only works if you printer is able to deal with unicode ( UTF-8 ).

if you printer is not able to understand unicode you need to convert it into a code page that your printer understands and whose character set contains all characters that you need to print.

Heavy Regards, RealHeavyDude.
 

Osborne

Active Member
A possible solution is to replace the £ with œ:

DEF VAR a AS CHAR INIT "rrrrœrr".
or
a = "rrrr" + CHR(156) + "rr".

The problem with this though is if printing to a printer that is okay with printing the £ or outputting to a file you will have the same problem.
 
Top