Loading ...
Sorry, an error occurred while loading the content.

Problem with printing files (:hardcopy)

Expand Messages
  • Valery Kondakoff
    Hello, all! Today I tried to print a text, containing Russian characters from GVIM using :hardcopy command and all the Russian charecters were printed as
    Message 1 of 7 , Mar 31, 2003
    • 0 Attachment
      Hello, all!

      Today I tried to print a text, containing Russian characters from
      GVIM using ':hardcopy' command and all the Russian charecters were
      printed as garbage - exactly as they were pasted to/from system
      clipboard before applying recent clipboard patch.

      What is this? Another multibyte bug or lack of experience from my
      side?

      I'm using GVIM 6.1.423, WinXP Pro. There are my language-related
      settings:

      >8<======================<start>======================>8<
      set encoding=utf-8
      set fileencoding=cp1251
      set fileencodings=cp1251,cp866,koi8-r
      set guifont=courier_new:h11
      set keymap=russian-jcukenwin
      >8<=======================<end>=======================>8<

      Thank you!

      --
      Best regards,
      Valery Kondakoff
      http://www.nbk.orc.ru (Ne Bey Kopytom)
      http://www.nbk.orc.ru/mtb (MTB riding in Moscow)

      PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...

      np: The Cure - Watching Me Fall (Bloodflowers)
    • Tony Mechelynck
      ... Maybe you should set the printfont option to some font that has the glyphs you want to print. (The default, it is said, is Courier:h10). Or else it could
      Message 2 of 7 , Mar 31, 2003
      • 0 Attachment
        Valery Kondakoff <strauss@...> wrote:
        > Hello, all!
        >
        > Today I tried to print a text, containing Russian characters from
        > GVIM using ':hardcopy' command and all the Russian charecters were
        > printed as garbage - exactly as they were pasted to/from system
        > clipboard before applying recent clipboard patch.
        >
        > What is this? Another multibyte bug or lack of experience from my
        > side?
        >
        > I'm using GVIM 6.1.423, WinXP Pro. There are my language-related
        > settings:
        >
        > > 8<======================<start>======================>8<
        > set encoding=utf-8
        > set fileencoding=cp1251
        > set fileencodings=cp1251,cp866,koi8-r
        > set guifont=courier_new:h11
        > set keymap=russian-jcukenwin
        > > 8<=======================<end>=======================>8<
        >
        > Thank you!
        >
        > --
        > Best regards,
        > Valery Kondakoff
        > http://www.nbk.orc.ru (Ne Bey Kopytom)
        > http://www.nbk.orc.ru/mtb (MTB riding in Moscow)
        >
        > PGP key:
        > mailto:pgp-public-keys@...?subject=GET%20strauss@...
        >
        > np: The Cure - Watching Me Fall (Bloodflowers)

        Maybe you should set the 'printfont' option to some font that has the glyphs
        you want to print. (The default, it is said, is Courier:h10). Or else it
        could be something overlooked in the CF_TEXT vs CF_UNICODETEXT programming.

        Warning:
        :let &pfn=&gfn
        ought to work, but
        :set printfont=*
        doesn't.

        HTH,
        Tony.
      • Valery Kondakoff
        Hello, Tony! ... TM Maybe you should set the printfont option to some font that has the glyphs TM you want to print. (The default, it is said, is
        Message 3 of 7 , Apr 1, 2003
        • 0 Attachment
          Hello, Tony!

          Tuesday, April 1, 2003, you wrote to me:

          >> Today I tried to print a text, containing Russian characters from
          >> GVIM using ':hardcopy' command and all the Russian charecters were
          >> printed as garbage - exactly as they were pasted to/from system
          >> clipboard before applying recent clipboard patch.

          TM> Maybe you should set the 'printfont' option to some font that has the glyphs
          TM> you want to print. (The default, it is said, is Courier:h10). Or else it
          TM> could be something overlooked in the CF_TEXT vs CF_UNICODETEXT programming.

          Thank you for a suggestion. Unfortunately, setting 'prinfont' option
          does not help. It successfully changes the font, but native characters
          are still not printed correctly.

          I think this is a bug, because when printed, each Russian letter is
          replaced with _two_ "garbage" characters. So - this seems to be
          character conversion error, and not just missing glyphs.

          2 Bram: do I need to perform some additional testing to make the
          problem clear? How can I help you with this?

          --
          Best regards,
          Valery Kondakoff
          http://www.nbk.orc.ru (Ne Bey Kopytom)
          http://www.nbk.orc.ru/mtb (MTB riding in Moscow)

          PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...

          np: Pussyfoot - Sea Breeze #C - Chari Chari (Fish Smell Like Cat) [stopped]
        • Bram Moolenaar
          ... Are you sure you are not using a multi-byte encoding? The printing only works for 8 bit encodings. Did you read section 3.2 in various.txt? -- Veni, Vidi,
          Message 4 of 7 , Apr 2, 2003
          • 0 Attachment
            Valery Kondakoff wrote:

            > 2 Bram: do I need to perform some additional testing to make the
            > problem clear? How can I help you with this?

            Are you sure you are not using a multi-byte encoding? The printing only
            works for 8 bit encodings.

            Did you read section 3.2 in various.txt?

            --
            Veni, Vidi, Video -- I came, I saw, I taped what I saw.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
            \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
          • Valery Kondakoff
            Hello, Bram! ... BM Are you sure you are not using a multi-byte encoding? The printing only BM works for 8 bit encodings. Excuse, pls, my ignorance: I m not
            Message 5 of 7 , Apr 3, 2003
            • 0 Attachment
              Hello, Bram!

              Thursday, April 3, 2003, you wrote to me:

              >> 2 Bram: do I need to perform some additional testing to make the
              >> problem clear? How can I help you with this?

              BM> Are you sure you are not using a multi-byte encoding? The printing only
              BM> works for 8 bit encodings.

              Excuse, pls, my ignorance: I'm not sure I understand the difference
              between 8 bit and multi-byte encodings. The texts, that I'm trying to
              print are in cp1251 encoding. Is it '8 bit' or 'multy-byte' encoding?

              Currently I'm reading 'mbyte.txt' again. As far as I understand,
              cp1251 is mentioned here as 8-bit encoding:

              1 latin1 8-bit characters (ISO 8859-1)
              1 iso-8859-n ISO_8859 variant (n = 2 to 15)
              1 koi8-r Russian
              1 koi8-u Ukrainian
              1 8bit-{name} any 8-bit encoding (Vim specific name)
              1 cp{number} MS-Windows: any installed single-byte codepage

              BM> Did you read section 3.2 in various.txt?

              Yes, I have read 3.1 and 3.2 sections. There is an excerpt from
              section 3.1:

              -----
              8-bit and Multi-byte support - There is limited support for 8-bit
              character set encodings. It is based on the Latin-1 encoding, modified
              for the host platform so that what is printed should match what VIM
              displays on screen. There is no support for multi-byte character sets
              - the characters are replaced with spaces.
              -----

              Help says that "multi-byte" characters are replaced with spaces when
              printing. And each Russian character in cp1251 encoding is replaced
              with two another (non-blank) characters.


              --
              Best regards,
              Valery Kondakoff
              http://www.nbk.orc.ru (Ne Bey Kopytom)
              http://www.nbk.orc.ru/mtb (MTB riding in Moscow)

              PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...
            • Bram Moolenaar
              ... It s an 8 bit encoding. But I assume your encoding is utf-8, which is what matters. Printing utf-8 is somewhere on the todo list, but it s not easy to
              Message 6 of 7 , Apr 3, 2003
              • 0 Attachment
                Valery Kondakoff wrote:

                > Thursday, April 3, 2003, you wrote to me:
                >
                > >> 2 Bram: do I need to perform some additional testing to make the
                > >> problem clear? How can I help you with this?
                >
                > BM> Are you sure you are not using a multi-byte encoding? The printing only
                > BM> works for 8 bit encodings.
                >
                > Excuse, pls, my ignorance: I'm not sure I understand the difference
                > between 8 bit and multi-byte encodings. The texts, that I'm trying to
                > print are in cp1251 encoding. Is it '8 bit' or 'multy-byte' encoding?

                It's an 8 bit encoding. But I assume your 'encoding' is utf-8, which
                is what matters.

                Printing utf-8 is somewhere on the todo list, but it's not easy to
                implement. Limited support for conversion from 'encoding' to
                'fileencoding' was suggested. Don't expect it soon...

                > Help says that "multi-byte" characters are replaced with spaces when
                > printing. And each Russian character in cp1251 encoding is replaced
                > with two another (non-blank) characters.

                Strange, it appears to work correctly for me.

                --
                WOMAN: Dennis, there's some lovely filth down here. Oh -- how d'you do?
                ARTHUR: How do you do, good lady. I am Arthur, King of the Britons.
                Who's castle is that?
                WOMAN: King of the who?
                The Quest for the Holy Grail (Monty Python)

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
              • Valery Kondakoff
                Hello, Bram! ... BM It s an 8 bit encoding. But I assume your encoding is utf-8, which BM is what matters. Ah. Yes, I set encoding to utf-8 , because
                Message 7 of 7 , Apr 3, 2003
                • 0 Attachment
                  Hello, Bram!

                  Friday, April 4, 2003, you wrote to me:

                  >> BM> Are you sure you are not using a multi-byte encoding? The printing only
                  >> BM> works for 8 bit encodings.
                  >>
                  >> Excuse, pls, my ignorance: I'm not sure I understand the difference
                  >> between 8 bit and multi-byte encodings. The texts, that I'm trying to
                  >> print are in cp1251 encoding. Is it '8 bit' or 'multy-byte' encoding?

                  BM> It's an 8 bit encoding. But I assume your 'encoding' is utf-8, which
                  BM> is what matters.

                  Ah. Yes, I set 'encoding' to 'utf-8', because this is the only
                  'encoding' settings, that allow encodings conversion. I mentioned this
                  in my previous message.

                  BM> Printing utf-8 is somewhere on the todo list, but it's not easy to
                  BM> implement. Limited support for conversion from 'encoding' to
                  BM> 'fileencoding' was suggested. Don't expect it soon...

                  OK. Thank you for explanation.

                  >> Help says that "multi-byte" characters are replaced with spaces when
                  >> printing. And each Russian character in cp1251 encoding is replaced
                  >> with two another (non-blank) characters.

                  BM> Strange, it appears to work correctly for me.

                  This is fully reproducible on several PCs. The "wrong" characters
                  looks exactly as they were pasted to/from system clipboard before
                  applying latest clipboard patch.

                  --
                  Best regards,
                  Valery Kondakoff
                  http://www.nbk.orc.ru (Ne Bey Kopytom)
                  http://www.nbk.orc.ru/mtb (MTB riding in Moscow)

                  PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...

                  np: The Cure - Bloodflowers (Bloodflowers) [stopped]
                Your message has been successfully submitted and would be delivered to recipients shortly.