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

Re: Using vim/gvim to edit EBCDIC on Windows

Expand Messages
  • drchip@campbellfamily.biz
    ... I suspect it has to do with whether or not vim is in binary mode or not. Anyway, here are some autocmds using iconv which set/unset binary mode to keep
    Message 1 of 4 , Dec 1, 2004
    • 0 Attachment
      Quoting Wayne Johnson <wdtj@...>:

      > Thanks for the suggestion.
      >
      > I tried dd (sorry, should have mentioned it earlier), and it seems to do
      > some really strange translations. Somehow the EBCDIC newline character
      > comes out as an 0x85?

      I suspect it has to do with whether or not vim is in binary mode or not.
      Anyway, here are some autocmds using iconv which set/unset binary
      mode to keep ebcdic and ascii in their appropriate places.

      " editing EBCDIC {{{2
      au BufReadPre */EBCDIC/*,*.ebcdic :let g:binkeep= &bin|set bin
      au BufReadPost */EBCDIC/*,*.ebcdic :%!iconv -f EBCDIC-US
      au BufReadPost */EBCDIC/*,*.ebcdic :let &bin= g:binkeep|unlet g:binkeep
      au BufWritePre */EBCDIC/*,*.ebcdic :let g:binkeep= &bin|set bin|%!iconv -t
      EBCDIC-US
      au BufWritePost */EBCDIC/*,*.ebcdic :let &bin= g:binkeep|unlet g:binkeep>

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