Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!polaris.utu.fi!tucos.utu.fi!knuutila From: knuutila@tucos.utu.fi (Timo Knuutila) Newsgroups: comp.text.tex Subject: Problem with TeX character codes Message-ID: <1991Feb7.112203.12456@polaris.utu.fi> Date: 7 Feb 91 11:22:03 GMT Sender: news@polaris.utu.fi Organization: University of Turku, Finland Lines: 49 Dear TeXackers, I encountered the following problem when trying to marry TeX, PostScript fonts and foreign language hyphenation in my TeX-system (SB-TeX, emTeX drivers and font libraries, dvips54, 386 PC). I have a scandinavian keyboard with special keys for the accented scandinavian letters (\"a, \"o, \"A, \"O, \aa, \AA) and I'm trying to map these to the corresponding PostScript character codes. In what follows, suppose that x, y, X and Y stand for the characters of a-, o-, A- and O-umlaut, respectively. The keyboard codes for the characters, ie. the codes TeX sees at the first glance, are as follows: x: 0x84 y: 0x94 X: 0x8E Y: 0x99 The easiest way to map these characters to something TeX knows about, would be \catcode`\x=\active \catcode`\y=\active \catcode`\X=\active \catcode`\Y=\active \defx{\"a} \defy{\"o} \defX{\"A} \defY{\"O} but then it would be impossible to hyphenate words containing these characters (and thus accents). They should be mapped directly to character codes (the same that are used in the hyphenation patterns) in order to maintain the hyphenation capability. The corresponding codes in the PostScript font tables are given below: x: 0x99 y: 0x89 X: 0xD2 Y: 0xBE I made the following macro definitions (after x etc had been declared to be active characters): \defx{^^99} \defy{^^89} \defX{^^d2} \defY{^^be} The problem is that the `keyboard code' of Y is the same as the PS character code of x (0x99). Thus, TeX maps x first to Y and then to ^^be, which is obviously not what I want. However, even if I change the \defx to (11 is the category code of letter characters) \defx{\catcode`^^99=11 ^^99\catcode`^^99=\active} the result is just the same --- x is mapped to ^^BE. Where have I gone wrong? Timo Knuutila knuutila@cs.utu.fi