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

Re: Copy and paste Spanish from google translate into vim?

Expand Messages
  • Daniel
    ... Thanks for replying. Here is what my ubuntu 12.10 (quetzal) vim --version shows related to patches: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26
    Message 1 of 10 , May 8 12:11 PM
    • 0 Attachment
      > Could you try a more recent vim version? I seem to remember several
      > clipboard patches which were supposed to fix unicode misbehaviour.

      > regards,
      > Christian

      Thanks for replying.

      Here is what my ubuntu 12.10 (quetzal) vim --version shows related to patches:

      VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:34)
      Included patches: 1-547

      ---------------------------------

      More recent ubuntu releases do not have more patches, according to the ubuntu packages website:

      raring (editors): Vi IMproved - enhanced vi editor
      2:7.3.547-6ubuntu5: amd64 i386

      ---------------------------------

      ftp://ftp.vim.org/pub/vim/patches/7.3/README does say verify what you say about a possible multi-byte glitch being fixed:
      8587 7.3.856 system() garbles multi-byte clipboard contents

      So I appreciate your suggestion and would like to apply the patch. But I don't want to compile vim from source code. Seems like a wild goose chase. Is there any other suggestion?

      As an alternative, I tried reinstalling the DOS version vim73_46 file, but as expected it says 7.3.46 when it starts up. So next I looked for a DOS version with all the patches applied.

      http://wyw.dcweb.cn/#download promised this. I downloaded and installed this DOS version with 7.3.918 but it also does not work correctly when using copy and paste for Spanish text. It malfunctions differently, but still garbles the letters. I changed the encoding from latin1 to utf-8 and tried again. Still garbles the letters. So I have patches up to 918 and does not seem to work.

      ---------------------------------

      Does anyone out there copy and paste non-English text into vim using the stable vim release? I copy and paste English text all the time, would be incredibly inefficient if I could not. It's a little hard for me to believe, with the huge non-English-speaking usage, I'm the only one that has noticed this problem. Could someone please take a look at my original post and tell me what I need to do different. Thanks

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      Hi Daniel! ... There are probably some PPA which provide more recent snapshots for Ubuntu. This one looks promising:
      Message 2 of 10 , May 8 1:43 PM
      • 0 Attachment
        Hi Daniel!

        On Mi, 08 Mai 2013, Daniel wrote:

        > > Could you try a more recent vim version? I seem to remember several
        > > clipboard patches which were supposed to fix unicode misbehaviour.
        >
        > > regards,
        > > Christian
        >
        > Thanks for replying.
        >
        > Here is what my ubuntu 12.10 (quetzal) vim --version shows related to patches:
        >
        > VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:34)
        > Included patches: 1-547
        >
        > ---------------------------------
        >
        > More recent ubuntu releases do not have more patches, according to the ubuntu packages website:
        >
        > raring (editors): Vi IMproved - enhanced vi editor
        > 2:7.3.547-6ubuntu5: amd64 i386
        >
        > ---------------------------------
        >
        > ftp://ftp.vim.org/pub/vim/patches/7.3/README does say verify what you say about a possible multi-byte glitch being fixed:
        > 8587 7.3.856 system() garbles multi-byte clipboard contents
        >
        > So I appreciate your suggestion and would like to apply the patch. But I don't want to compile vim from source code. Seems like a wild goose chase. Is there any other suggestion?

        There are probably some PPA which provide more recent snapshots for
        Ubuntu. This one looks promising:
        https://launchpad.net/~nmi/+archive/vim-snapshots

        >
        > As an alternative, I tried reinstalling the DOS version vim73_46 file, but as expected it says 7.3.46 when it starts up. So next I looked for a DOS version with all the patches applied.
        >
        > http://wyw.dcweb.cn/#download promised this. I downloaded and installed this DOS version with 7.3.918 but it also does not work correctly when using copy and paste for Spanish text. It malfunctions differently, but still garbles the letters. I changed the encoding from latin1 to utf-8 and tried again. Still garbles the letters. So I have patches up to 918 and does not seem to work.

        Are you using those on Windows? If so, then there might still be bugs in
        the Windows clipboard handling. I have however never noticed anything
        like that, I only know of X11 multibyte problems (which I thaught were
        fixed now). However I can't contribute to the Windows code. You might
        want to report this as bug to the vim-dev mailinglist.

        regards,
        Christian
        --

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Daniel
        ... Thank you very much. I tried the ppa installation, following their directions, and ran into some difficulties. It complained it could not get a key. Then
        Message 3 of 10 , May 8 2:51 PM
        • 0 Attachment
          On Wednesday, May 8, 2013 1:43:13 PM UTC-7, Christian Brabandt wrote:
          >
          >
          > There are probably some PPA which provide more recent snapshots for
          > Ubuntu. This one looks promising:
          > https://launchpad.net/~nmi/+archive/vim-snapshots
          >
          >
          > Are you using those on Windows? If so, then there might still be bugs in
          > the Windows clipboard handling. I have however never noticed anything
          > like that, I only know of X11 multibyte problems (which I thaught were
          > fixed now). However I can't contribute to the Windows code. You might
          > want to report this as bug to the vim-dev mailinglist.
          >
          > regards,
          > Christian
          >
          > --

          Thank you very much. I tried the ppa installation, following their directions, and ran into some difficulties. It complained it could not get a key. Then when I tried to install with apt-get, it did not work. But I kept trying, eventually figured out I must have made a mistake, it did install. I was able to open vim and it was version 7.3.918 with all the patches.

          When I tried to copy and paste, it had the same problem.

          Next, I took another look at putty. It turns out there is a 'settings / translation / received data assumed to be in which character set' configuration menu that was set to a "western europe" setting. When I changed that to UTF-8, it worked. :) sintoma pasted correctly, accent and everything. I should have suspected and looked at that before. As usual, things are obvious in retrospect.

          Thanks so much for the help. You got me in the right direction, helped rule out possible sources of the problem, eventually I was able to track down the problem with your help. Thanks again.

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Dominique Pellé
          ... Copy/paste from Firefox into Vim does not work for me either for non ASCII characters if I use the middle click to paste in Vim (terminal) on Linux. It
          Message 4 of 10 , May 8 11:50 PM
          • 0 Attachment
            Daniel <healthdatawarehouse@...> wrote:

            > Hi,
            >
            > I would be very thankful if someone could tell me how to set things up so I can copy and paste
            > Spanish text from google translate into vim? I am sure there is some very simple way to do this,
            > but I can't see it.

            Copy/paste from Firefox into Vim does not work for me either for
            non ASCII characters if I use the middle click to paste in Vim (terminal)
            on Linux. It copies text, but messes up accents. I think that Vim puts
            a latin1 string and then interprets it as utf-8 so it looks messed up.
            Taking your example, if I copy/paste "síntoma" from Firefox with the
            mouse, I see in Vim (terminal) "s<ed>ntoma" . <ed> being in Latin1:

            355 237 ED í LATIN SMALL LETTER I WITH ACUTE

            However, it works if I select the text in Firefox and drag it into the
            terminal. Copy/paste also work with middle click in gvim.

            I just realized now that copy paste actually works when I use
            "vim -u NONE". So by trial and error, I searched for the minimalistic
            .vimrc that can reproduce the problem. I can reproduce the
            copy/paste bug as follows:

            1/ create a minimalistic ~/.vimrc file:

            $ cat ~/.vimrc
            set enc=utf8
            language eo.UTF-8
            set mouse=a

            2/ Start vim with:

            $ vim --noplugin

            3/ Copy a word with accents in Firefox such as "síntoma"
            and paste it in Vim (terminal) with middle click.

            4/ Observe the bug Vim pastes: s<ed>ntoma
            Expected behavior was to paste "síntoma"
            Note also that dragging the selection from Firefox
            to Vim pastes correctly.

            Interestingly, bug happens with the "eo.UTF8" language
            but not with the "fr_FR.UTF8" language for example.

            You may need to install the eo.UTF8 locale in order to reproduce
            the bug with "sudo locale-gen eo.UTF8" as described here
            for Ubuntu:

            http://markushedlund.com/dev-tech/install-a-locale-on-ubuntu-11-10

            Regards
            Dominique

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Christian Brabandt
            Hi Dominique! ... Interesting. I don t see this behaviour here. regards, Christian -- Mancher lehnt eine gute Idee bloß deshalb ab, weil sie nicht von ihm
            Message 5 of 10 , May 9 4:18 AM
            • 0 Attachment
              Hi Dominique!

              On Do, 09 Mai 2013, Dominique Pellé wrote:

              > Copy/paste from Firefox into Vim does not work for me either for
              > non ASCII characters if I use the middle click to paste in Vim (terminal)
              > on Linux. It copies text, but messes up accents. I think that Vim puts
              > a latin1 string and then interprets it as utf-8 so it looks messed up.
              > Taking your example, if I copy/paste "síntoma" from Firefox with the
              > mouse, I see in Vim (terminal) "s<ed>ntoma" . <ed> being in Latin1:
              >
              > 355 237 ED í LATIN SMALL LETTER I WITH ACUTE
              >
              > However, it works if I select the text in Firefox and drag it into the
              > terminal. Copy/paste also work with middle click in gvim.
              >
              > I just realized now that copy paste actually works when I use
              > "vim -u NONE". So by trial and error, I searched for the minimalistic
              > .vimrc that can reproduce the problem. I can reproduce the
              > copy/paste bug as follows:
              >
              > 1/ create a minimalistic ~/.vimrc file:
              >
              > $ cat ~/.vimrc
              > set enc=utf8
              > language eo.UTF-8
              > set mouse=a
              >
              > 2/ Start vim with:
              >
              > $ vim --noplugin
              >
              > 3/ Copy a word with accents in Firefox such as "síntoma"
              > and paste it in Vim (terminal) with middle click.
              >
              > 4/ Observe the bug Vim pastes: s<ed>ntoma
              > Expected behavior was to paste "síntoma"
              > Note also that dragging the selection from Firefox
              > to Vim pastes correctly.
              >
              > Interestingly, bug happens with the "eo.UTF8" language
              > but not with the "fr_FR.UTF8" language for example.
              >
              > You may need to install the eo.UTF8 locale in order to reproduce
              > the bug with "sudo locale-gen eo.UTF8" as described here
              > for Ubuntu:
              >
              > http://markushedlund.com/dev-tech/install-a-locale-on-ubuntu-11-10

              Interesting. I don't see this behaviour here.

              regards,
              Christian
              --
              Mancher lehnt eine gute Idee bloß deshalb ab, weil sie nicht von ihm
              ist.
              -- Luis Bunuel

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Dominique Pellé
              ... OK. Do you have the eo.UTF8 locale? I can reproduce it on 2 different Linux x86_64 machines (xubuntu-12.04 and xubuntu-12.10). It might be a problem
              Message 6 of 10 , May 9 5:10 AM
              • 0 Attachment
                Christian Brabandt <cblists@...> wrote:

                > Hi Dominique!
                >
                > On Do, 09 Mai 2013, Dominique Pellé wrote:

                ...snip...
                >> I just realized now that copy paste actually works when I use
                >> "vim -u NONE". So by trial and error, I searched for the minimalistic
                >> .vimrc that can reproduce the problem. I can reproduce the
                >> copy/paste bug as follows:
                >>
                >> 1/ create a minimalistic ~/.vimrc file:
                >>
                >> $ cat ~/.vimrc
                >> set enc=utf8
                >> language eo.UTF-8
                >> set mouse=a
                >>
                >> 2/ Start vim with:
                >>
                >> $ vim --noplugin
                >>
                >> 3/ Copy a word with accents in Firefox such as "síntoma"
                >> and paste it in Vim (terminal) with middle click.
                >>
                >> 4/ Observe the bug Vim pastes: s<ed>ntoma
                >> Expected behavior was to paste "síntoma"
                >> Note also that dragging the selection from Firefox
                >> to Vim pastes correctly.
                >>
                >> Interestingly, bug happens with the "eo.UTF8" language
                >> but not with the "fr_FR.UTF8" language for example.
                >>
                >> You may need to install the eo.UTF8 locale in order to reproduce
                >> the bug with "sudo locale-gen eo.UTF8" as described here
                >> for Ubuntu:
                >>
                >> http://markushedlund.com/dev-tech/install-a-locale-on-ubuntu-11-10
                >
                > Interesting. I don't see this behaviour here.
                >
                > regards,
                > Christian

                OK. Do you have the eo.UTF8 locale? I can reproduce it on 2 different
                Linux x86_64 machines (xubuntu-12.04 and xubuntu-12.10). It might be
                a problem with the eo.UTF8 locale rather than Vim.

                Dominique

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • glts
                ... I m not sure whether this is relevant, but the ISO language code for Spanish is es , not eo . eo is the language code for Esperanto, which is supported
                Message 7 of 10 , May 9 7:22 AM
                • 0 Attachment
                  On Thursday, May 9, 2013 2:10:23 PM UTC+2, Dominique Pelle wrote:
                  > OK. Do you have the eo.UTF8 locale? I can reproduce it on 2
                  > different Linux x86_64 machines (xubuntu-12.04 and xubuntu-12.10). It
                  > might be a problem with the eo.UTF8 locale rather than Vim.

                  I'm not sure whether this is relevant, but the ISO language code for
                  Spanish is "es", not "eo".

                  "eo" is the language code for Esperanto, which is supported by far fewer
                  systems. Maybe what you've discovered is a flaw in the Esperanto locale.

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Christian Brabandt
                  Hi Dominique! ... I generated it using the locale-gen command. This is ubuntu 12.10 regards, Christian -- Was man besonders gerne tut, ist selten ganz
                  Message 8 of 10 , May 11 2:30 PM
                  • 0 Attachment
                    Hi Dominique!

                    On Do, 09 Mai 2013, Dominique Pellé wrote:

                    > Christian Brabandt <cblists@...> wrote:
                    >
                    > > Hi Dominique!
                    > >
                    > > On Do, 09 Mai 2013, Dominique Pellé wrote:
                    >
                    > ...snip...
                    > >> I just realized now that copy paste actually works when I use
                    > >> "vim -u NONE". So by trial and error, I searched for the minimalistic
                    > >> .vimrc that can reproduce the problem. I can reproduce the
                    > >> copy/paste bug as follows:
                    > >>
                    > >> 1/ create a minimalistic ~/.vimrc file:
                    > >>
                    > >> $ cat ~/.vimrc
                    > >> set enc=utf8
                    > >> language eo.UTF-8
                    > >> set mouse=a
                    > >>
                    > >> 2/ Start vim with:
                    > >>
                    > >> $ vim --noplugin
                    > >>
                    > >> 3/ Copy a word with accents in Firefox such as "síntoma"
                    > >> and paste it in Vim (terminal) with middle click.
                    > >>
                    > >> 4/ Observe the bug Vim pastes: s<ed>ntoma
                    > >> Expected behavior was to paste "síntoma"
                    > >> Note also that dragging the selection from Firefox
                    > >> to Vim pastes correctly.
                    > >>
                    > >> Interestingly, bug happens with the "eo.UTF8" language
                    > >> but not with the "fr_FR.UTF8" language for example.
                    > >>
                    > >> You may need to install the eo.UTF8 locale in order to reproduce
                    > >> the bug with "sudo locale-gen eo.UTF8" as described here
                    > >> for Ubuntu:
                    > >>
                    > >> http://markushedlund.com/dev-tech/install-a-locale-on-ubuntu-11-10
                    > >
                    > > Interesting. I don't see this behaviour here.
                    > >
                    > > regards,
                    > > Christian
                    >
                    > OK. Do you have the eo.UTF8 locale? I can reproduce it on 2 different
                    > Linux x86_64 machines (xubuntu-12.04 and xubuntu-12.10). It might be
                    > a problem with the eo.UTF8 locale rather than Vim.

                    I generated it using the locale-gen command. This is ubuntu 12.10

                    regards,
                    Christian
                    --
                    Was man besonders gerne tut, ist selten ganz besonders gut.

                    --
                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_use" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  Your message has been successfully submitted and would be delivered to recipients shortly.