edit UTF-8 text files under vi or mg?

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

edit UTF-8 text files under vi or mg?

Jiri Navratil
Hello,

Is it possible to edit UTF-8 text files under vi or mg?

I'm using some machines, where I need to touch UTF-8 encoded files only
rarely. I would prefer to avoid installation of Vim there and instead
use a "in OS included" text editor. Is that possible and how to use and
configure them?

Thank you,
Jiri

--
Jiri Navratil, http://kouc.navratil.cz, +420 222 767 131

Reply | Threaded
Open this post in threaded view
|

Re: edit UTF-8 text files under vi or mg?

Stuart Henderson
On 2015-09-12, Jiri Navratil <[hidden email]> wrote:

> Hello,
>
> Is it possible to edit UTF-8 text files under vi or mg?
>
> I'm using some machines, where I need to touch UTF-8 encoded files only
> rarely. I would prefer to avoid installation of Vim there and instead
> use a "in OS included" text editor. Is that possible and how to use and
> configure them?
>
> Thank you,
> Jiri
>

The closest thing is editors/nvi from ports.

Reply | Threaded
Open this post in threaded view
|

Re: edit UTF-8 text files under vi or mg?

Theo Buehler
In reply to this post by Jiri Navratil
On Sat, Sep 12, 2015 at 11:02:13AM +0200, Jiri Navratil wrote:
> Hello,
>
> Is it possible to edit UTF-8 text files under vi or mg?

As far as I know most base utilities do not yet have UTF-8 support, but
it might be coming soon, as announced in stsp@'s c2k15 report:

http://undeadly.org/cgi?action=article&sid=20150722182236

where it is also mentioned that ksh(1), mg(1) and vi(1) don't
support UTF-8, yet.

> I'm using some machines, where I need to touch UTF-8 encoded files only
> rarely. I would prefer to avoid installation of Vim there and instead
> use a "in OS included" text editor. Is that possible and how to use and
> configure them?

I think nvi would be a good alternative to vim:

$ pkg_info nvi-2.1.3
Information for http://mirror.switch.ch/ftp/pub/OpenBSD/snapshots/packages/amd64/nvi-2.1.3.tgz

Comment:
ex/vi text editor with wide character support

Description:
Nvi is an implementation of the ex/vi text editor originally distributed as
part of the Fourth Berkeley Software Distribution (4BSD), by the University
of California, Berkeley.

Nvi supports all the historic ex/vi features except for open mode and the
lisp edit option (e.g., it has a fully implemented underlying ex mode). It
has a number of additional features as well:

* 8-bit clean data, lines and files limited by available memory
* Multiple edit buffers
* Colon command-line editing and path name completion
* Tag stacks (including support for Cscope databases)
* Extended Regular Expressions
* Infinite undo
* Horizontal scrolling
* Message catalogs
* Wide character support

Available flavors:
        iconv - support conversion between different character encodings

Maintainer: Anthony J. Bentley <[hidden email]>

WWW: https://github.com/lichray/nvi2

Reply | Threaded
Open this post in threaded view
|

Re: edit UTF-8 text files under vi or mg?

Christian Weisgerber
In reply to this post by Jiri Navratil
On 2015-09-12, Jiri Navratil <[hidden email]> wrote:

> Is it possible to edit UTF-8 text files under vi or mg?

The editors in base do not support UTF-8 yet.

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: edit UTF-8 text files under vi or mg?

Alexander Hall
In reply to this post by Jiri Navratil
On September 12, 2015 11:02:13 AM GMT+02:00, Jiri Navratil <[hidden email]> wrote:
>Hello,
>
>Is it possible to edit UTF-8 text files under vi or mg?

I'll add to the replies that you've already received that it is quite possible to edit UTF-8 files with vi from base, just that you won't be able to see the proper glyphs, but instead "\xc3\xa5" etc.

So while is inconvenient for text editing, the characters themselves are not a showstopper.

/Alexander

>
>I'm using some machines, where I need to touch UTF-8 encoded files only
>rarely. I would prefer to avoid installation of Vim there and instead
>use a "in OS included" text editor. Is that possible and how to use and
>configure them?
>
>Thank you,
>Jiri