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

Re: pasted ' and " turning to ¿

Expand Messages
  • Tony Mechelynck
    ... Word documents are not plaintext: they aren t the kind of thing Vim is built to handle. If you can t save as plaintext or as HTML from OOo, try WordPad
    Message 1 of 8 , Aug 1, 2007
    • 0 Attachment
      ben lieb wrote:
      > My clients are always giving me word documents to convert to HTML. When
      > I paste the text into vim, the curly ' and " always turn to ¿ and it's
      > driving me crazy. Why can't vim handle these? I've even tried using open
      > office to stop this, but to no avail. What can I do?

      Word documents are not plaintext: they aren't the kind of thing Vim is built
      to handle. If you can't save "as plaintext" or "as HTML" from OOo, try WordPad
      instead. I don't know what WordPad's "as Rich Text" option means but you could
      take a look at it, just in case. (Your headers say you're on Windows so I'm
      trying to give a Windows answer).



      Best regards,
      Tony.
      --
      The war between Emacs and Vi is over. Vi has won with 3 to 1.
      http://www.ssc.com/lg/issue30/raymond.html

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • fREW
      ... I had a similar issue in a class that I took where the teacher distributed the notes as word files and they had funny characters in them. Basically what I
      Message 2 of 8 , Aug 1, 2007
      • 0 Attachment
        > office to stop this, but to no avail. What can I do?

        I had a similar issue in a class that I took where the teacher
        distributed the notes as word files and they had funny characters in
        them. Basically what I did was paste the doc into the terminal with:

        cat > newfile

        And then I used a suggestion on the list that will highlight weird
        characters like curly " and ' and I use the same pattern in a search
        and replace the characters with whatever makes sense.

        It's not automated, but it saves time and makes the files regular
        ascii and smaller in ram and disk than the word file.

        --
        -fREW

        Q: Why is this email 5 sentences or less?
        A: http://five.sentenc.es

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • John R. Culleton
        ... Gimp and someday Krita. -- John Culleton --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For
        Message 3 of 8 , Aug 1, 2007
        • 0 Attachment
          On Wednesday 01 August 2007, ben lieb wrote:
          > fREW wrote:
          > >> office to stop this, but to no avail. What can I do?
          > >
          > > I had a similar issue in a class that I took where the teacher
          > > distributed the notes as word files and they had funny characters
          > > in them. Basically what I did was paste the doc into the
          > > terminal with:
          > >
          > > cat > newfile
          > >
          > > And then I used a suggestion on the list that will highlight
          > > weird characters like curly " and ' and I use the same pattern in
          > > a search and replace the characters with whatever makes sense.
          > >
          > > It's not automated, but it saves time and makes the files regular
          > > ascii and smaller in ram and disk than the word file.
          >
          > I don't think this is a plain text issue, since the curvy quotes
          > still show up in the plain text, and also show up as ¿ when pasted
          > into vim. Maybe window's plain text is slightly different from
          > linux?
          >
          > There is an option while saving from .doc to .txt 'allow character
          > substitution'. This actually converts from curvy to straight
          > quotes. There is also an option in word that makes word use
          > straight quotes, but this doesn't convert curvy quotes in other's
          > documents.
          >
          > And, yes I'm on windows (can't find a replacement for photoshop,
          Gimp and someday Krita.



          --
          John Culleton

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • ben lieb
          ... I don t think this is a plain text issue, since the curvy quotes still show up in the plain text, and also show up as ¿ when pasted into vim. Maybe
          Message 4 of 8 , Aug 1, 2007
          • 0 Attachment
            fREW wrote:
            office to stop this, but to no avail. What can I do?
                
            I had a similar issue in a class that I took where the teacher
            distributed the notes as word files and they had funny characters in
            them.  Basically what I did was paste the doc into the terminal with:
            
            cat > newfile
            
            And then I used a suggestion on the list that will highlight weird
            characters like curly " and ' and I use the same pattern in a search
            and replace the characters with whatever makes sense.
            
            It's not automated, but it saves time and makes the files regular
            ascii and smaller in ram and disk than the word file.
            
              
            I don't think this is a plain text issue, since the curvy quotes still show up in the plain text, and also show up as ¿ when pasted into vim. Maybe window's plain text is slightly different from linux?

            There is an option while saving from .doc to .txt 'allow character substitution'. This actually converts from curvy to straight quotes. There is also an option in word that makes word use straight quotes, but this doesn't convert curvy quotes in other's documents.

            And, yes I'm on windows (can't find a replacement for photoshop, or flash).



            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---

          • Tony Mechelynck
            ... It s not plain text, it s Word format, which has interspersed control characters. I think that that is one of them. I can read Word files on Linux with
            Message 5 of 8 , Aug 1, 2007
            • 0 Attachment
              ben lieb wrote:
              > fREW wrote:
              >>> office to stop this, but to no avail. What can I do?
              >>>
              >>
              >> I had a similar issue in a class that I took where the teacher
              >> distributed the notes as word files and they had funny characters in
              >> them. Basically what I did was paste the doc into the terminal with:
              >>
              >> cat > newfile
              >>
              >> And then I used a suggestion on the list that will highlight weird
              >> characters like curly " and ' and I use the same pattern in a search
              >> and replace the characters with whatever makes sense.
              >>
              >> It's not automated, but it saves time and makes the files regular
              >> ascii and smaller in ram and disk than the word file.
              >>
              >>
              > I don't think this is a plain text issue, since the curvy quotes still
              > show up in the plain text, and also show up as ¿ when pasted into vim.
              > Maybe window's plain text is slightly different from linux?

              It's not plain text, it's Word format, which has interspersed control
              characters. I think that that is one of them. I can read Word files on Linux
              with oowriter and on Windows with WordPad, but not with Vim on either platform.

              >
              > There is an option while saving from .doc to .txt 'allow character
              > substitution'. This actually converts from curvy to straight quotes.
              > There is also an option in word that makes word use straight quotes, but
              > this doesn't convert curvy quotes in other's documents.
              >
              > And, yes I'm on windows (can't find a replacement for photoshop, or flash).

              Well, I used to be, but now I've graduated to Linux :-).


              Best regards,
              Tony.
              --
              An Englishman never enjoys himself, except for a noble purpose.
              -- A. P. Herbert

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • John Beckett
              ... I think it s just your font. I ve been meaning to check this for a while so I created the following which suits my once-a-year purpose. Change ANSI dashes
              Message 6 of 8 , Aug 1, 2007
              • 0 Attachment
                ben lieb wrote:
                > My clients are always giving me word documents to
                > convert to HTML. When I paste the text into vim, the
                > curly ' and " always turn to ¿

                I think it's just your font.

                I've been meaning to check this for a while so I created the following which
                suits my once-a-year purpose.

                "Change ANSI dashes and quotes to ascii.
                :%s/\%x96\|\%x97/-/eg | %s/\%x91\|\%x92/'/eg | %s/\%x93\|\%x94/"/eg

                Hex 96,97 = en,em dash; 91,92 = single quotes, 93,94 = double quotes.

                Google just showed me the following; probably should add bullets and maybe
                more in above substitute.
                http://www.cyrillic.com/3dkbd/ansichart.html

                There are probably tools to convert ANSI to ASCII.

                John


                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              Your message has been successfully submitted and would be delivered to recipients shortly.