This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to print textfiles in Cygwin 1.7?


2010/1/12 Niklaus Kuehnis:
> I've upgraded to Cygwin 1.7 (release version, clean install) and now am unable to print text files with non-ascii characters (i.e. German umlauts) from commandline.
>
> On Cygwin 1.5 printing used to work with a2ps but now all umlauts are replaced by strange characters (i.e. the u with diaeresis appears as a capital A with a tilde and '1/4'). The same happens with lpr. The files print fine using the Windows text editor.

The problem is that both a2ps and lpr don't yet support UTF-8.
Instead, they interpret the UTF-8 bytes as ISO-8859-1, which is why
umlauts, which are represented as two bytes in UTF-8, appear as two
funny characters.

a2ps has the -X option to tell it explicitly what encoding to use, but
unfortunately:

$ a2ps -X UTF-8
a2ps: unknown encoding `utf-8'

One workaround is to convert the file manually using iconv, e.g.:

$ iconv -f utf-8 -t iso-8859-1 bla.txt | a2ps -o bla.ps

(Of course this only works properly as long as your file doesn't have
any characters outside iso-8859-1.)


> I'm using mintty on Windows Vista Business and nano to produce the files. Files with umlauts are recognized as UTF-8 by the file command.

Please note that 'nano' also doesn't support UTF-8 yet. While entering
characters looks like it works initially, nano will internally think
that you've entered two characters when you enter an umlaut. Hence
things get wonky when you try to edit them.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]