Hi ZyX,

Here is a specific example:

I have a string that has 8-bits characters in the 128-255 range

:let a ="<97><9e>·<97>¢<96><9b>Ü<88>å<82>ÌÂ<98>Ð0"

I need to map each character to specific strings, for which I have a
dictionary (mappings below) for each character 128-255. For example, <97>
maps to "AA". I use the substitute() function along with submatch to do
that.

let retval = substitute(value, '\([\d128-\d255]\)',
'\=mappings[submatch(1)]', "g")

It appears to me that substitute() seems to be running based off the current
encoding setting, even if I converted all the rest to "latin1" using iconv()
functions.


Thanks for any help!




On Sun, Mar 20, 2011 at 1:54 PM, ZyX <[email protected]> wrote:

> Reply to message «lazyredraw for encoding change?»,
> sent 23:18:31 20 March 2011, Sunday
> by [email protected]:
>
> What do you switch? 'encoding'? You are not supposed to do this ever, why
> don't
> you use `iconv()', `scriptencoding utf-8', 'fileencoding', `e ++enc' or
> some
> other stuff depending on what you actually do in your script. Can you
> provide
> more specific example?
>
> Original message:
> > Hello All,
> >
> > I have a script which needs to manipulate strings in 8-bit characters.
> So,
> > I switch between the current encoding and the 8-bit encoding. However,
> the
> > screen redraws during the change of encoding. Is there a way to suppress
> > it?
> >
> > Thanks!
>

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui