Can you edit EBCDIC files on non-OS390 builds of VIM?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Can you edit EBCDIC files on non-OS390 builds of VIM?

Justin Dearing
I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
Included patches: 1-872
Compiled by <[hidden email]>
Huge version without GUI.  Features included (+) or not (-):
<snip/>
-ebcdic          +mouse           +smartindent     -xim
<snip/>

I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Andrew Long-7
On 31 Jan 2016, at 02:32, Justin Dearing wrote:

> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <[hidden email]>
> Huge version without GUI.  Features included (+) or not (-):
> <snip/>
> -ebcdic          +mouse           +smartindent     -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?
I edit copies of mainframe files locally by using netrw, and get ftp to translate between Ascii & EBCDIC

Regards, Andy


--
Andrew Long
Andrew dot Long at Mac dot com


--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (242 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Random832
In reply to this post by Justin Dearing
Justin Dearing <[hidden email]> writes:
> I'd like to edit EBCDIC encoded files in VIM on windows vim

Windows VIM apparently supports all windows codepages as file
encodings [++enc=cpNNN] including cp37 and cp1047, etc. It seems
to work fine for me, though I'm not sure if there are any subtle
aspects that could cause problems.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Eric Christopherson
In reply to this post by Justin Dearing
On Sat, Jan 30, 2016, Justin Dearing wrote:

> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <[hidden email]>
> Huge version without GUI.  Features included (+) or not (-):
> <snip/>
> -ebcdic          +mouse           +smartindent     -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option.
> Looking at src/auto/configure, it looks like ebcdic support is enabled
> if ASCII support is not present. Is there an option to turn it on?

Sorry, I don't know the answer to that, but I find it interesting to see
this question, just a few days after reading a page laying out the case
for NeoVim -- although I can't find the exact page now, I believe it
gave EBCDIC support as an example of something that no one would ever
use Vim for!

--
        Eric Christopherson

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Nikolay Aleksandrovich Pavlov
In reply to this post by Justin Dearing
2016-01-31 5:32 GMT+03:00 Justin Dearing <[hidden email]>:

> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <[hidden email]>
> Huge version without GUI.  Features included (+) or not (-):
> <snip/>
> -ebcdic          +mouse           +smartindent     -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?

+ebcdic means that *internal encoding* of Vim will be EBCDIC AFAIK.
And by “internal encoding” I mean not &encoding (though this also),
but encoding used by the compiler as well. I do not think this is what
you want.

To edit ebcdic file you need +iconv and you need to know how iconv
names used encoding. E.g. I can edit file using `e ++enc=ebcdicus`,
but `iconv --list | grep --ignore-case ebcdic | wc --lines` shows 77
*EBCDIC* encoding variants. Some look like an aliases to other (like
`ebcdic-us` and `ebcdicus`), but I can’t be sure.

>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Nikolay Aleksandrovich Pavlov
In reply to this post by Eric Christopherson
2016-02-01 2:14 GMT+03:00 Eric Christopherson <[hidden email]>:

> On Sat, Jan 30, 2016, Justin Dearing wrote:
>> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>>
>> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
>> Included patches: 1-872
>> Compiled by <[hidden email]>
>> Huge version without GUI.  Features included (+) or not (-):
>> <snip/>
>> -ebcdic          +mouse           +smartindent     -xim
>> <snip/>
>>
>> I cloned the git repo and configure --enable-ebcdic was not an option.
>> Looking at src/auto/configure, it looks like ebcdic support is enabled
>> if ASCII support is not present. Is there an option to turn it on?
>
> Sorry, I don't know the answer to that, but I find it interesting to see
> this question, just a few days after reading a page laying out the case
> for NeoVim -- although I can't find the exact page now, I believe it
> gave EBCDIC support as an example of something that no one would ever
> use Vim for!

Editing EBCDIC files is *not* what EBCDIC support in Vim means. It is
support for compiling and operating on systems where EBCDIC is an
encoding used by the compiler (specifically in string and character
literals). You may see in configure:

    AC_TRY_COMPILE([ ],
    [ /* TryCompile function for CharSet.
       Treat any failure as ASCII for compatibility with existing art.
       Use compile-time rather than run-time tests for cross-compiler
       tolerance.  */
    #if '0'!=240
    make an error "Character set is not EBCDIC"
    #endif ],
    [ # TryCompile action if true
    cf_cv_ebcdic=yes ],
    [ # TryCompile action if false
    cf_cv_ebcdic=no])

: to enable +ebcdic it is necessary that `'0' == 240`. Unfortunately
even C99 does not talk about ASCII (or any specific encoding at all)
in 6.4.4.4 Character constants section, so this thing is permitted by
the standard.

>
> --
>         Eric Christopherson
>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Tony Mechelynck
In reply to this post by Justin Dearing
On Sun, Jan 31, 2016 at 3:32 AM, Justin Dearing <[hidden email]> wrote:

> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <[hidden email]>
> Huge version without GUI.  Features included (+) or not (-):
> <snip/>
> -ebcdic          +mouse           +smartindent     -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?
>

IIUC, +ebcdic means "compiled on an EBCDIC machine", IOW, the Vim
_source_ was in EBCDIC. In order to edit EBCDIC _data_ files it is
enough to have a Vim which can thanslate the data losslessly back and
forth between the file's 'fileencoding' (i.e. the charset the file
uses on disk) and Vim's 'encoding' (i.e. the charset Vim uses in
memory, for which UTF-8 is the recommended value).

I expect that any Vim compiled with +iconv (or with +iconv/dyn with
the iconv or libiconv library found at runtime) should be able to edit
such files _provided_ that their 'fileencoding' be recognized when the
time comes to edit them. One of the possible ways is to tell Vim the
'fileencoding' when loading the file in order to edit it. See:
    iconv --list
    :help ++opt
    http://vim.wikia.com/wiki/Working_with_Unicode

The first of these tells you which charsets are known to the iconv
program installed on your system (There are usually very many, so you
may want to filter the output though the less pager, or even through
"view -" without quotes). The second one tells you how to tell Vim the
charset of a given editfile. The third is general information about
using Vim for editing files not all in the same charset, by setting
Vim to use Unicode internally so any charset can be translated
losslessly to and from the one used internally by Vim.

Example:
  :new ++enc=ebcdic-us /path/to/filename.ext

will edit the file in a new window and translate it from EBCDIC(US) to
Vim's 'encoding' (e.g. to UTF-8) when reading; when comes the time to
save your edited file, the opposite translation will happen.


Best regards,
Tony.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Justin Dearing
In reply to this post by Justin Dearing
On Sunday, January 31, 2016 at 4:43:25 AM UTC-5, Justin Dearing wrote:
> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:

I just read all the answers here. Apparently I was not subscribed to this post because the moderator didn't approve me, and I forgot all about it. Thanks, its been quite informative.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Justin Dearing
In reply to this post by Eric Christopherson
On Sunday, January 31, 2016 at 6:14:49 PM UTC-5, Eric Christopherson wrote:
> I find it interesting to see
> this question, just a few days after reading a page laying out the case
> for NeoVim . . . it
> gave EBCDIC support as an example of something that no one would ever
> use Vim for!

Ok that seems weird. Throwing out Netware support is the perfect case for a dying user base not worth the #ifdefs they require. Throwing out a lot of windows support written in the NT 4.0 days, to put back cleaner code that will compile VS 2013 and GCC with less ifdefs. However, mainframes are not dying any time soon, and I'm pretty sure still EBCDIC at the core.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Nikolay Aleksandrovich Pavlov
2016-02-08 21:35 GMT+03:00 Justin Dearing <[hidden email]>:
> On Sunday, January 31, 2016 at 6:14:49 PM UTC-5, Eric Christopherson wrote:
>> I find it interesting to see
>> this question, just a few days after reading a page laying out the case
>> for NeoVim . . . it
>> gave EBCDIC support as an example of something that no one would ever
>> use Vim for!
>
> Ok that seems weird. Throwing out Netware support is the perfect case for a dying user base not worth the #ifdefs they require. Throwing out a lot of windows support written in the NT 4.0 days, to put back cleaner code that will compile VS 2013 and GCC with less ifdefs. However, mainframes are not dying any time soon, and I'm pretty sure still EBCDIC at the core.

Who and how will test this? I only heard about some [unofficial
mainframe emulator][1], using which will probably have law issues: not
with emulator itself, but with OS and compiler.

Also do you have an access to such mainframe and can you test whether
*Vim* compiles there with EBCDIC macros defined? As I mentioned
earlier last patch for EBCDIC systems is very old and when new
features are added programmers adding them do not think about EBCDIC;
most of them (including me) do not even know what exactly needs to be
taken into account.

I am as well quite sure that those mainframes will not have Neovim
installed simply because policy does not allow installing random
software, especially for a reason that it is slightly better then Vim
(if it is there) or Vi (even though not so slightly here).

[1]: https://en.wikipedia.org/wiki/Hercules_(emulator)

>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Justin Dearing


On Mon, Feb 8, 2016 at 3:14 PM Nikolay Aleksandrovich Pavlov <[hidden email]> wrote:
Also do you have an access to such mainframe and can you test whether
*Vim* compiles there with EBCDIC macros defined?

 I'm not a mainframe guy I'm dealing with the IBM i (formerly AS/400). That's a midrange. Completely different OS. It runs on Power chips. VIM runs inside of an AIX-like subsystem. I would ask the people that run pub1.de for access to a box running 7.2 of the OS to test neovim compilation there.

Now if you want a windows machine to test compiling NeoVIM with the ability to read EBCDIC pages on, I can perhaps be of some assistance.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

LCD 47
On 8 February 2016, Justin Dearing <[hidden email]> wrote:

> On Mon, Feb 8, 2016 at 3:14 PM Nikolay Aleksandrovich Pavlov <
> [hidden email]> wrote:
>
> > Also do you have an access to such mainframe and can you test
> > whether *Vim* compiles there with EBCDIC macros defined?
>
>
>  I'm not a mainframe guy I'm dealing with the IBM i (formerly
> AS/400).  That's a midrange. Completely different OS. It runs on Power
> chips. VIM runs inside of an AIX-like subsystem. I would ask the
> people that run pub1.de for access to a box running 7.2 of the OS to
> test neovim compilation there.
>
> Now if you want a windows machine to test compiling NeoVIM with the
> ability to read EBCDIC pages on, I can perhaps be of some assistance.

    I haven't paid much attention to this discussion, but perhaps this
might help.  Vim can edit gzipped files.  To do that, it decompresses
the file, it lets you edit it, and compresses it back.  Perhaps you can
do the same with encoding instead of compression.

    For encoding conversion, you might look at umap(1) from Perl's
Unicode::Map8.  It seems to know about a few EBCDIC encodings, maybe one
of them is suitable for your files.

    /lcd

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Can you edit EBCDIC files on non-OS390 builds of VIM?

Charles Campbell
In reply to this post by Justin Dearing
Justin Dearing wrote:

> I'd like to edit EBCDIC encoded files in VIM on windows vim --version shows this:
>
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
> Included patches: 1-872
> Compiled by <[hidden email]>
> Huge version without GUI.  Features included (+) or not (-):
> <snip/>
> -ebcdic          +mouse           +smartindent     -xim
> <snip/>
>
> I cloned the git repo and configure --enable-ebcdic was not an option. Looking at src/auto/configure, it looks like ebcdic support is enabled if ASCII support is not present. Is there an option to turn it on?
>
I haven't used EBCDIC in decades, I'm afraid.   I mostly use Scientific
Linux.  I have some leftover script that still seems to work:

"  editing EBCDIC {{{2
augroup EBCDIC
 au!
 au BufReadPre  */EBCDIC/*  :let g:binkeep= &bin|set bin
 "au BufReadPost */EBCDIC/*  :%!iconv -f EBCDIC-US
 au BufReadPost */EBCDIC/*  :%!dd conv=ascii
 au BufReadPost */EBCDIC/*  :let &bin= g:binkeep|unlet g:binkeep
 "au BufWritePre */EBCDIC/*  :let g:binkeep= &bin|set bin|%!iconv -t
EBCDIC-US
 au BufWritePre */EBCDIC/*  :let g:binkeep= &bin|set bin|%!dd conv=ebcdic
 au BufWritePost */EBCDIC/* :let &bin= g:binkeep|unlet g:binkeep
augroup END

So, I have an EBCDIC directory; anything in it is, presumably EBCDIC.
Still works with the vim I use. Clearly, its using system tools (iconv,
dd) which you're unlikely to have under Windows, unless cygwin happens
to provide them and you use cygwin.

So, if its of use, enjoy!  If not, ignore at will.

Chip Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.