![如何在 groff 中正确显示波兰语变音符号?](https://linux22.com/image/143288/%E5%A6%82%E4%BD%95%E5%9C%A8%20groff%20%E4%B8%AD%E6%AD%A3%E7%A1%AE%E6%98%BE%E7%A4%BA%E6%B3%A2%E5%85%B0%E8%AF%AD%E5%8F%98%E9%9F%B3%E7%AC%A6%E5%8F%B7%EF%BC%9F.png)
我正在玩groff
,我想从以下内容生成一个pdftest.ms
.TL
Tytuł
.AU
Imię Nazwisko
.NH
Wstęp
.PP
Pierwszy paragraf. Jakieś informacje, żeby były polskie znaki.
.PP
Drugi paragraf. Reszta znaków:
ąęćłńśóżźĄĘĆŁŃŚÓŻŹ
.NH
Bla bla bla
.PP
safsdsdfsasdds
正如您所看到的,它包含波兰语变音符号。编译后groff -ms test.ms -T pdf > test.pdf
我们会看到这样的混乱:
我的第一个猜测是使用 utf-8 支持重新编译。
$ groff -Kutf8 -ms test.ms -T pdf > test.pdf
test.ms:4: warning: can't find special character `u0065_0328'
test.ms:8: warning: can't find special character `u0073_0301'
test.ms:8: warning: can't find special character `u00A0'
test.ms:8: warning: can't find special character `u007A_0307'
test.ms:12: warning: can't find special character `u0061_0328'
test.ms:12: warning: can't find special character `u006E_0301'
test.ms:12: warning: can't find special character `u007A_0301'
test.ms:12: warning: can't find special character `u0041_0328'
test.ms:12: warning: can't find special character `u0045_0328'
test.ms:12: warning: can't find special character `u004E_0301'
test.ms:12: warning: can't find special character `u0053_0301'
test.ms:12: warning: can't find special character `u005A_0307'
test.ms:12: warning: can't find special character `u005A_0301'
Groff 忽略了大部分符号,pdf 看起来像这样:
经过一番谷歌搜索后我发现这:
groff -Kutf8 -Tdvi -mec -ms test.ms > test.dvi
dvipdfm -cz 9 test.dvi
是的,它仍然失败(虽然更好,只跳过了一个字符):
$ groff -Kutf8 -Tdvi -mec -ms test.ms > test.dvi
test.ms:8: warning: can't find special character `u00A0'
我怎样才能让它发挥作用?
编辑:这是输出locale
LANG=pl_PL.UTF-8
LANGUAGE=
LC_CTYPE="pl_PL.UTF-8"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="pl_PL.UTF-8"
LC_COLLATE="pl_PL.UTF-8"
LC_MONETARY="pl_PL.UTF-8"
LC_MESSAGES="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_ALL=
答案1
性格A0
是一个牢不可破的空间。看起来它介于“Jakies”和“infomacje”之间。使用编辑器将其替换为普通空格,然后就可以开始了。
建议:我已经设置了我的编辑器(emacs、vim)来突出显示牢不可破的空格,因为当我在输入需要按的字符后点击时,有时我会无意中用AltGr+键入一些空格。spacespaceAltGr
您第一次猜测后的警告似乎表明某些字符(ę、ś、ż...)是通过组合变音符号而不是本地编码的。例如 ę == e(十六进制 65)+ 组合 ogonek(十六进制 328)而不是“e 与 ogonek”(十六进制 119)。你如何编辑你的源文件?您可以使用撰写键来生成带变音符号的“独立”字母,例如Compose e ,“ę”。
答案2
该问题可能是由于groff
.
看这个链接。