Specifying character sets

For printers that allow selectable character sets, determine the names of the character sets and then map each set to a name or number in the terminfo database.

  • To determine the names of the character sets listed in the terminfo database, enter:
      tput -T printer-type csnm 0
    Theprinter-type is the name of the printer type in question. This command should display the name of the 0th character set (the character set obtained by default after the printer is initialized).

    To display the names of the other character sets, repeat the command above, replacing 0 with 1, 2, 3, and so on. In general, the terminfo names should closely match the names used in the user documentation for the printer. However, because not all manufacturers use the same names, the terminfo names may differ from one printer type to the next.

  • To specify a list of character set names and to map them into terminfo names or numbers, enter:
      /usr/sbin/lpadmin -p printer_name -S characterset_list
    The characterset_list is a list of names, separated by commas or spaces. If you use spaces to separate the names, enclose the entire list (but not the -S) in quotes. Each item in the list is a character set name mapping (alias) that looks like one of the following:
      csN=characterset_name
      characterset_name1=characterset_name2
    The variable N is a number between 0 and 63 that identifies the number of the character set in the terminfo database. characterset_name1 identifies the character set by its name in the terminfo database. In both instances, the name to the right of the equal sign (=) is the name you choose as an alias of the character set.
    Note: You do not have to provide a list of aliases for the character sets if the terminfo names are adequate. You can refer to a character set by terminfo name, by number, or by your alias.
    For example, your printer has two selectable character sets (sets #1 and #2) in addition to the standard character set (set #0). The printer type is 5310. Enter the following commands to determine the names of the selectable character sets:
    tput -T 5310 csnm 1english
    tput -T 5310 csnm 2finnish
    The words english and finnish, which are the names of the selectable character sets, are the output of the commands. The name finnish is adequate for referring to character set 2, but better names are needed for the standard set (set 0) and set 1. Enter the following command to define synonyms:
      /usr/sbin/lpadmin -p printer_name -S "cs0=american, english=british"
    The following three commands will then produce identical results. (The lp command routes print jobs to the printer, and in these examples, routes the print job to any printer capable of handling the cs1 character set.)
      lp -S cs1 -d any . . .
    
      lp -S english -d any . . .
    
    
      lp -S british -d any . . .

    If you do not list the character sets that can be used with a printer, the service assumes a printer that has selectable character sets can take any csN name or terminfo name known for the printer.

  • To remove the character set mappings, enter:
      /usr/sbin/lpadmin -p printer_name -S none