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

Problems with national characters in the file-path

Expand Messages
  • Valery Kondakoff
    Hello, vim-gurus! Something is broken in GVim parsing the national characters in the file-path if file is open from the command line. There is the description
    Message 1 of 6 , Aug 30, 2004
    • 0 Attachment
      Hello, vim-gurus!

      Something is broken in GVim parsing the national characters in
      the file-path if file is open from the command line.

      There is the description of the problem: I'm creating a test dir, name
      it in Russian ('C:\tmp\тест') and place 'GPL.html' file into this dir.

      Now I'm trying to open 'GPL.html' in GVim using this command line:
      'F:\TOOLS\VIM\vim63\gvim.exe C:\tmp\тест\GPL.html'. The file can't be
      open this way - see the screenshot ( http://www.nncron.ru/temp/vim.png
      ).

      It's interesting, that the same file can be opened using ':bro e' GVim
      command. There is a screenshot ( http://www.nncron.ru/temp/vim1.png ).

      What is wrong there? (I tested this on GVim 6.3, Win2000 SP4).

      Thank you.

      --
      Best regards,
      Valery Kondakoff mailto:strauss@...

      PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...
    • panshizhu@routon.com
      I ve got the same, if the file name or file path contains chinese character, there may be problem opening the file when the encoding set to utf-8. If
      Message 2 of 6 , Aug 30, 2004
      • 0 Attachment
        I've got the same, if the file name or file path contains chinese
        character, there may be problem opening the file when the 'encoding' set
        to utf-8.

        If 'encoding' set to the local one, i.e. 'cp936', there will never be
        problem opening chinese-named files or paths.

        (The Above tested on Win2000SP4 Chinese version. gVim6.3)

        Try to reset your 'encoding' to the local one and try again?


        --
        Sincerely, Pan Shizhu, ext: 2221

        Valery Kondakoff <strauss@...> wrote on 2004-08-31 00:02:21:

        > Hello, vim-gurus!
        >
        > Something is broken in GVim parsing the national characters in
        > the file-path if file is open from the command line.
        >
        > There is the description of the problem: I'm creating a test dir, name
        > it in Russian ('C:\tmp\тест') and place 'GPL.html' file into this
        dir.
        >
        > Now I'm trying to open 'GPL.html' in GVim using this command line:
        > 'F:\TOOLS\VIM\vim63\gvim.exe C:\tmp\тест\GPL.html'. The file can't
        be
        > open this way - see the screenshot ( http://www.nncron.ru/temp/vim.png
        > ).
        >
        > It's interesting, that the same file can be opened using ':bro e' GVim
        > command. There is a screenshot ( http://www.nncron.ru/temp/vim1.png ).
        >
        > What is wrong there? (I tested this on GVim 6.3, Win2000 SP4).
        >
        > Thank you.
        >
        > --
        > Best regards,
        > Valery Kondakoff mailto:strauss@...
        >
        > PGP key:
        mailto:pgp-public-keys@...?subject=GET%20strauss@...
      • Valery Kondakoff
        Hello, Valery! Monday, August 30, 2004, 8:02:21 PM, you wrote: VK There is the description of the problem: I m creating a test dir, name VK it in Russian
        Message 3 of 6 , Aug 31, 2004
        • 0 Attachment
          Hello, Valery!

          Monday, August 30, 2004, 8:02:21 PM, you wrote:

          VK> There is the description of the problem: I'm creating a test dir, name
          VK> it in Russian ('C:\tmp\тест') and place 'GPL.html' file into this dir.

          VK> Now I'm trying to open 'GPL.html' in GVim using this command line:
          VK> 'F:\TOOLS\VIM\vim63\gvim.exe C:\tmp\тест\GPL.html'. The file can't be
          VK> open this way - see the screenshot (
          VK> http://www.nncron.ru/temp/vim.png
          VK> ).

          VK> It's interesting, that the same file can be opened using ':bro e' GVim
          VK> command. There is a screenshot (
          VK> http://www.nncron.ru/temp/vim1.png ).

          There are additions to my previous bug-report. I have found a line
          'autocmd BufEnter * lcd %:p:h' in my vimrc and commented it out.

          But the problem still exists. Take a look at these two screenshots.
          The first screenshot was made after I tried to open a file from the
          command line: http://www.nncron.ru/temp/path.png

          The second screenshot ( http://www.nncron.ru/temp/path1.png ) was made
          after I opened the same file using ':bro e' comand. Do you see the
          difference? The name of the directory which contains national
          characters is displayed correctly only when the file is opened using
          ':bro e'. Why?

          Can you explain - what is wrong there?

          (Win2000 SP4, GVim 6.3)

          Here are my language settings:

          set encoding=utf-8 " internal encoding for GVim
          set fileencoding=cp1251 " default encoding for a newly created files
          set fileencodings=ucs-bom,utf-8,cp1251,cp866,koi8-r
          set printencoding=cp1251 " encoding for printing
          set guifont=courier_new:h11
          set keymap=russian-jcukenwin




          --
          Best regards,
          Valery Kondakoff mailto:strauss@...

          PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...
        • Bram Moolenaar
          ... The problem probably is that the console uses another encoding. Vim gets the file name in that encoding, but expects it to be in UTF-8. That won t work. I
          Message 4 of 6 , Aug 31, 2004
          • 0 Attachment
            Valery Kondakoff wrote:

            > Monday, August 30, 2004, 8:02:21 PM, you wrote:
            >
            > VK> There is the description of the problem: I'm creating a test dir, name
            > VK> it in Russian ('C:\tmp\ÔÅÓÔ') and place 'GPL.html' file into this dir.
            >
            > VK> Now I'm trying to open 'GPL.html' in GVim using this command line:
            > VK> 'F:\TOOLS\VIM\vim63\gvim.exe C:\tmp\ÔÅÓÔ\GPL.html'. The file can't be
            > VK> open this way - see the screenshot (
            > VK> http://www.nncron.ru/temp/vim.png
            > VK> ).
            >
            > VK> It's interesting, that the same file can be opened using ':bro e' GVim
            > VK> command. There is a screenshot (
            > VK> http://www.nncron.ru/temp/vim1.png ).

            The problem probably is that the console uses another encoding. Vim
            gets the file name in that encoding, but expects it to be in UTF-8.
            That won't work.

            I don't see a good way for gvim to detect what encoding the arguments
            are in. They might as wel be in UTF-8, when started from a UTF-8
            capable shell. Not that this is very likely to happen on MS-Windows.

            A solution could be (although it's not that reliable) to check the name
            for invalid UTF-8 characters, and if there are any assume the file name
            is in the active codepage. Main problem with this would be that the
            encoding used in a console might very well differ from the active code
            page (as in MS-DOS versus MS-Windows encodings).

            --
            hundred-and-one symptoms of being an internet addict:
            268. You get up in the morning and go online before getting your coffee.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
            \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
          • Valery Kondakoff
            Hello, Bram! Wednesday, September 1, 2004, 1:31:48 AM, you wrote: BM The problem probably is that the console uses another encoding. Vim BM gets the file
            Message 5 of 6 , Sep 1, 2004
            • 0 Attachment
              Hello, Bram!

              Wednesday, September 1, 2004, 1:31:48 AM, you wrote:

              BM> The problem probably is that the console uses another encoding. Vim
              BM> gets the file name in that encoding, but expects it to be in UTF-8.
              BM> That won't work.

              BM> I don't see a good way for gvim to detect what encoding the arguments
              BM> are in. They might as wel be in UTF-8, when started from a UTF-8
              BM> capable shell. Not that this is very likely to happen on MS-Windows.

              BM> A solution could be (although it's not that reliable) to check the name
              BM> for invalid UTF-8 characters, and if there are any assume the file name
              BM> is in the active codepage. Main problem with this would be that the
              BM> encoding used in a console might very well differ from the active code
              BM> page (as in MS-DOS versus MS-Windows encodings).

              I think this solution is better than nothing. Maybe it is possible to
              create another one option to set the codepage encoding (say,
              'codepage')? This will allow to use a construct like this:

              if has("gui_running")
              set codepage=cp1251
              else
              set codepage=cp866
              endif



              --
              Best regards,
              Valery Kondakoff mailto:strauss@...

              PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...
            • Antoine J. Mechelynck
              ... There are already encoding and termencoding . In console vim, I would expect encoding to be set automatically at startup to whatever the terminal
              Message 6 of 6 , Sep 1, 2004
              • 0 Attachment
                Valery Kondakoff <strauss@...> wrote:
                > Hello, Bram!
                >
                > Wednesday, September 1, 2004, 1:31:48 AM, you wrote:
                >
                > > The problem probably is that the console uses another encoding. Vim
                > > gets the file name in that encoding, but expects it to be in UTF-8.
                > > That won't work.
                >
                > > I don't see a good way for gvim to detect what encoding the
                > > arguments are in. They might as wel be in UTF-8, when started from
                > > a UTF-8 capable shell. Not that this is very likely to happen on
                > > MS-Windows.
                >
                > > A solution could be (although it's not that reliable) to check the
                > > name for invalid UTF-8 characters, and if there are any assume the
                > > file name is in the active codepage. Main problem with this would
                > > be that the encoding used in a console might very well differ from
                > > the active code page (as in MS-DOS versus MS-Windows encodings).
                >
                > I think this solution is better than nothing. Maybe it is possible to
                > create another one option to set the codepage encoding (say,
                > 'codepage')? This will allow to use a construct like this:
                >
                > if has("gui_running")
                > set codepage=cp1251
                > else
                > set codepage=cp866
                > endif

                There are already 'encoding' and 'termencoding'. In console vim, I would
                expect 'encoding' to be set automatically at startup to whatever the
                terminal screen supports; and I suspect that moving it away from there would
                be a source of unending problems. Or did I miss something?

                Regards,
                Tony.
              Your message has been successfully submitted and would be delivered to recipients shortly.