Other Cannot imput or read £ character in vi

Hi,

I need to create a simple script to replace £ characters for £.
When I create a filter in vi to later be called using
find httpdocs/ -type f -name '*.shtml' -exec sed -i .bak -f sedcmd.txt {} \+
the £ character is translated to \xc2\xa3 in the vi file

Could someone please help me find a way ?
I tried adding the following in /home/username/.login_config but without positive outcome
Code:
me:\
        :charset=UTF-8:\
        :lang=en_GB.UTF-8:\
        :setenv=LC_COLLATE=C:
~
 
a bit off subject...
Will this work?
find httpdocs/ -type f -name '*.shtml' -exec sed -i .bak -e 's/£/£/g' {} \+
 
I would suggest you to set even charset and LC_COLLATE to en_GB.UTF-8. My locales are all set
to an UTF-8 language, and vi show £ correctly.

Then try with this:
find httpdocs/ -type f -name '*.shtml' -exec sed -i .bak 's/£/\£/g' {} \;

Worked well for me. :)
 
I would suggest you to set even charset and LC_COLLATE to en_GB.UTF-8
Do you mean replacing my .login_config file with
Code:
me:\
        :charset=en_GB.UTF-8:\
        :lang=en_GB.UTF-8:\
        :setenv=LC_COLLATE=en_GB.UTF-8
Is this what you mean?

Thank you
 
Exactly, but I did a little mistake: charset is ok with UTF-8, set only LC_COLLATE to en_GB.UTF-8.

Personally, I set even all other LC_* variables to my favorite language.
 
Back
Top