Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with special Spanish characters in PCL 5e

Status
Not open for further replies.

cjoyce

Programmer
May 12, 2003
5
US
Hi. We produce PCL 5e code to print electronic forms and we are having problems getting special Spanish characters like to output correctly. For example, the '¿' (upside-down question mark) gets converted to a '?'. I did some research and believe it has to do with the Symbol Set command. Please correct me if I'm wrong. For most of our fonts like Arial, Times, etc. (we support all of the default fonts for HP/Lexmark printers) we use 19U which is listed in the manuals as "Windows 3.1 Latin 1". A few are different - Antique Olive uses 9U, Symbol uses 9U.

Can someone tell me which symbol set to use? Is there a better default symbol set to use that encompasses all characters for single-byte languages such as english/spanish, etc.? I'm wondering what's the best method to choose the Symbol Set for a font like Arial without having the user tell me they are designing a document that uses Spanish characters.

Thanks,
Chris
 
Try Roman-8...

<esc>(8U

Jim Asman
jlasman@telus.net
 
Symbol Set 0N (ISO8859/1 Latin-1) is the basic 'Western European' coded character set; this set uses character ranges as follows:[ul]
[li]0x00->0x1f: control codes
[li]0x20->0x7f: basic ASCII printable characters
[li]0x80->0x9f: undefined control codes
[li]0xa0->0xff: extended ASCII (Western European)
[/ul]

Symbol set 19U (Windows 3.1 Latin-1) is a superset of 0N, where extra printable characters replace the undefined control codes in the range 0x80-0x9f .

On modern LaserJet printers (and clones), all of the standard text fonts support both of these symbol sets, (except for the (bitmap) LinePrinter font, which does not support 19U).

Symbol fonts like Symbol, Wingdings, etc. have their own symbol sets.

I recommend that you use 19U wherever possible.

Do bear in mind that whatever coded character set you use, both input (keyboard, application, etc) and output (screen, printer, etc.) must be employing the same one.
 
The problem with symbol sets like 8U ([Roman-8) is that they generally do not provide a one-to-one mapping with the coded character sets used on most (single-byte) systems:[ul]
[li]Most Unix/Linux systems default to use of the ISO8859/1 Latin-1 coded character set; this corresponds to the HP symbol set 0N.
[li]Windows systems default to use of the Windows 3.1 Latin-1 coded character set; this corresponds to the HP symbol set 19U, which (as mentioned above) is a superset of 0N.
[/ul]

Symbol set 8U will match the ISO8859/1 Latin-1 repertoire for characters in the range 0x00-0x7f, but uses a different set of character shapes for codepoints 0xa0-0xff; you can't even work out a translation between the two, because the set of glyphs (character shapes) defined in 8U is not the same as that in 0N.
 
I forgot to mention that ISO 8859/1 (i.e. symbol set 0N) is a subset (the Basic Multilingual Plane) of the 16-bit Unicode standard, as used internally on modern Windows and Unix/Linux systems.
 
Thanks for the replies guys. I found my problem and it didn't have anything to do with PCL. I'm using Microsoft .NET for a printing component I've written and needed to get the text I was printing from a string object to a byte[]. In .NET there is a function called System.Text.Encoding.ASCII.GetBytes(). The only equivalent is Unicode.GetBytes() or UTF-8, UTF-7. which I don't want to use because it doubles the size of my PCL. Anyway, ASCII.GetBytes() was replacing anything above 127 with a '?'. I had to make my own function to iterate over each char in the string and add it to a byte array.

Sorry for the confusion! At least I know 19U is the correct symbol set. :)

Regards,
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top