[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: Re[2]: Problem printing unicode
From:       "Antoine J. Mechelynck" <antoine.mechelynck () belgacom ! net>
Date:       2004-01-28 15:19:35
Message-ID: 000f01c3e5b2$23ceca40$63c0c950 () tonymec
[Download RAW message or body]

Alex Jakushev <Alex.Jakushev@kemek.lt> wrote:
> Hello Antoine,
>
> Wednesday, January 28, 2004, 3:48:59 PM, you wrote:
>
> > You aren't the only one. AFAIK, in Windows, the printer interprets
> > anything sent from gvim (in gvim's 'encoding') as if it were
> > encoded in the Windows codepage. The following little test (shown
> > with the answers I get on my gvim
> > 6.2.170 for W32) will instruct you about your 'printencoding'
> > option:
>
> >     :echo exists("&printencoding")
> > 1
>
> >     :echo exists("+printencoding")
> > 0
>
> > Morality: on my system, 'printencoding' is defined, but it is not
> > functional.
>
> > AFAIK, at the moment, the only solutions are as follows (both
> > unsatisfactory to me):
>
> > (a) Move to a system where it works, such as Linux with PostScript;
>
> > (b) Delve into the Vim code, find out what would need changing to
> > make 'printencoding' work properly on MS-Windows systems (where
> > :hardcopy does not use PostScript), make the necessary changes,
> > check that they work on Windows and do not break what was already
> > working on Unix-like systems, and publish a patch. Beware that
> > encodings are not always treated identically under W95/W98 and
> > under NT/2K, and have a thought for W16 (Win 3.1) too. If you go
> > this route, you might want to subscribe to the vim-dev and
> > vim-multibyte lists (if you don't already).
>
> > If you can do neither (a) nor (b) above, consider sponsoring Vim,
> > then voting in favour of adding a _functional_ 'printencoding'
> > option to Vim versions for Win32 with printing and without
> > PostScript. (The way I see it, it should describe the printer's
> > encoding to Vim, like 'termencoding' describes the keyboard's
> > encoding.)
>
> > Best regards,
> > Tony.
>
> There's another solution that I use right now - print the file from
> notepad :) It works well with XP (2000?) notepad, especially if You
> don't
> forget to add BOM (and don't care about syntax highlighting and
> printer selection):
>
> :!start notepad /p %
>
> (BTW, if someone knows how to set printer to print to for notepad from
> command line, please let me know)
>
> There're other UTF viewers that do the job well too, such as
> TotalCommander's
> viewer or View64.
>
> I just thought that since vim can print by itself, it could do it
> correctly ...
>
> Best regards,
>  Alex                            mailto:Alex.Jakushev@kemek.lt
>
> ---------------------------------------
> Alex Jakushev,            ( mailto:Alex.Jakushev@kemek.lt )
> Programmer,
>
> "KEMEK Elektronika" UAB   ( http://www.kemek.lt )
> member of VAROS GROUP     ( http://www.varosgroup.com )
>
> Work  : +370 5 2491024
> Fax   : +370 5 2491019
> Mob.  : +370 685 44885
> ICQ   : 81495642

It does NOT work from W98 Notepad, which knows only one kind of files: 8-bit
files in the current Windows codepage.

In Windows 98, WordPad knows about Unicode, and it will display and print a
UTF-8 file correctly if it has a BOM (to do that in Vim, use ":setlocal
bomb" with the cursor in the file in question -- if the file already has a
BOM, and 'fileencodings' starts with "ucs-bom", the option should have been
set automagically by Vim). However, if you save the file as "Unicode text"
from WordPad, it will not be in UTF-8 but in UCS-2le, still with BOM (and
Vim should be able to open it if its 'fileencodings' start with "ucs-bom").

I still believe that a pure-Vim solution (to use, e.g., :hardcopy with a
range when 'encoding' != WinCodePage) is sorely missing.

Regards,
Tony.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic