user1773603
user1773603

Reputation:

substituting a pattern with special french characters

In the following text :

la zone convective s?~@~Yetend

I would like to replace with sed the characters (who are joined) ?~@~Yby a simple quote and the "é" letter

The right french text is : la zone convective s'étend

I have tried under vim by selecting the text :

'<,'>s/?~@~Y/\'é/g

and

'<,'>s/\?\~\@\~Y/\'é/g

but none of two works.

I have also used CTRL+V and type the ' + é characters from my keyboard but without success.

Anyone could have a trick to acheive this substitution under vim ?

UPDATE 1: I am using vim on a Debian 8.0 with locale below and connected by ssh from a MacOS HighSierra to this Debian :

LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

Upvotes: 0

Views: 69

Answers (1)

phd
phd

Reputation: 94716

Screen tilde with backslashes but nothing else:

:'<,'>s/?\~@\~Y/'é/g

Other characters are not special, no need to escape them. Even worse — \? is special so using it alone in the regexp would be an error.

Upvotes: 0

Related Questions