On 12/26/23, holger.herrl...@posteo.de <holger.herrl...@posteo.de> wrote: > echo Ä | gpic > .if !dPS .ds PS > .if !dPE .ds PE > .lf 1 - > gpic:<standard input>:1: invalid input character code 132 > �
Hi Holger, The paste above doesn't reveal what sequences of bytes your "echo" is outputting, but I deduce it's UTF-8, since "U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS" is encoded in UTF-8 as the two-byte hex sequence c3 84, the latter byte of which is 132 decimal, which is the number in your error message. This is what I get in a UTF-8 environment: $ echo Ä | od -t u1 0000000 195 132 10 0000003 Unfortunately, the groff toolchain doesn't speak UTF-8, only Latin-1 (and expanding this is a longstanding wish-list item: http://savannah.gnu.org/bugs/?40720). So before pic sees the input, you'll have to convert it to a form pic understands. The most flexible way to do this is with groff's preconv tool, because this will convert a wide range of Unicode input into escapes that the groff tools understand. $ echo Ä | preconv -eutf-8 .lf 1 - \[u00C4] If all your input falls into the Latin-1 range, you can instead use the system iconv command to convert everything to Latin-1 (a.k.a. ISO 8859-1). $ echo Ä | iconv -futf-8 -tiso-8859-1 | od -t u1 0000000 196 10 0000002