vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: insert-string garbling characters


From: Thomas Dickey
Subject: Re: insert-string garbling characters
Date: Tue, 1 Dec 2020 19:58:37 -0500
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Dec 01, 2020 at 04:18:48AM -0500, Thomas Dickey wrote:
> On Mon, Nov 30, 2020 at 02:06:40PM +0000, Thomas Dupond wrote:
> > Thank you very much for your fast reply and this small patch.
> > I downloaded version 9.8u and applied the patch but now
> > whenever I try to insert an é interactively I only get : \?E9
> 
> ouch - I'll continue investigating a fix for this (thanks)

Here's a followup (apply after the previous patch) which seems to work.

I've attached the test-scripts that I used:
        I is mapped to an insert (using UTF-8)
        J is mapped to an insert using ^Vu
        K sets the buffer to 8bit
        M uses the insert-string command.
  
> > And this goes for every character like èéêîïôöûù they do not
> > appear correctly. When I switch to 8bit encoding with
> > `setl fk=8bit` \?E9 appears correctly as é.
> > 
> > On the bright side, when I use insert-string with UTF-8
> > encoding, the characters appear normally in the command prompt
> > and insert-string works as intended.
> 
> halfway there :-)
>  
> > I realised that you use `setl fk=8bit` and with this encoding
> > everything work as intended, interactive and insert-string. But
> > I would rather use UTF-8 than ISO-8859.
> > 
> > I'm sorry I cannot be of much help, I have very little
> > knowledge of C programming.
> > 
> > Regards,
> > Thomas Dupond
> > 
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > Le lundi, novembre 30, 2020 1:59 AM, Thomas Dickey <dickey@his.com> a écrit 
> > :
> > 
> > > On Sun, Nov 29, 2020 at 04:21:24PM +0000, Thomas Dupond wrote:
> > >
> > > > Hello,
> > > > I'm just starting on exploring vile and I fell on something I
> > > > cannot solve. I was trying to write a macro and while vile
> > > > seems to handle UTF8 really well it doesn't seem to work well
> > > > with the function insert-string.
> > > > I can insert "é" but when I use "insert-string é" it prints this
> > > > mess : ᅢᄅ
> > >
> > > yes... scripting hasn't been as well-tested as interactive stuff :-(
> > >
> > > > Any idea on how to solve this ?
> > >
> > > Here's a fix for the most common case (it won't handle a special
> > > case where the buffer is non-UTF-8), which should work for you.
> > >
> > > also attaching a script I used for testing, e.g.,
> > > ./configure --enable-trace --with-builtin-filters && make
> > > ./vile @foo.rc makefile
> > >
> > > > My locale is :
> > > > LANG=en_GB.UTF-8
> > > > LANGUAGE=en_GB:en
> > >
> > > ...
> > >
> > > > I'm on debian 4.19 and I compiled vile-9.8 from source with
> > >
> > > 9.8's getting a little stale - 9.8u is current.
> > >
> > > I put snapshots in github (but have too many concurrent things to
> > > polish off 9.8v)
> > >
> > > > ./configure --with-builtin-filters
> > > > And $cfgopts = hypertext,locale,iconv,multibyte,terminfo
> > > > Kind regards,
> > > > Thomas
> > >
> > > --
> > >
> > > Thomas E. Dickey dickey@invisible-island.net
> > > https://invisible-island.net
> > > ftp://ftp.invisible-island.net
> > 
> > 
> 
> -- 
> Thomas E. Dickey <dickey@invisible-island.net>
> https://invisible-island.net
> ftp://ftp.invisible-island.net



-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: fix2.patch
Description: Text Data

Attachment: foo.rc
Description: Text document

Attachment: foo2.rc
Description: Text document

Attachment: foo3.rc
Description: Text document

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]