On 24/03/09 22:07, mitch wrote:
>
> I’ve been trying to search a file for non-ascii chars using
>
> /[\x80-\xff]/
>
> and it’s not working.  How would I search for chars in the range of
> hex 80 to hex ff?  Thanks,
>
> - Mitch

Try the following (both untested):

Method I.

1) Read the file disregarding any multibyte encoding:

        :e ++enc=latin1 filename.ext

2) Do the search

        /[<80>-ÿ]

where <80> (which, depending on your 'encoding', may appear as ~@ 
instead) is obtained by hitting Ctrl-V x 8 0 and ÿ is a lowercase y with 
diaeresis, which your keyboard may or may not be able to produce 
natively. If it isn't, use Ctrl-V x F F

-- And in both cases, use Ctrl-Q instead of Ctrl-V if your Ctrl-V is 
remapped to the paste operation.


Method II (Only if 'encoding' is UTF-8).

1) Make sure the 'fileencoding' is 8-bit

        :setlocal fenc=latin1

2) Use the 8g8 command in Normal mode (see "help 8g8")



Best regards,
Tony.
-- 
Dear Mister Language Person: I am curious about the expression, "Part
of this complete breakfast".  The way it comes up is, my 5-year-old
will be watching TV cartoon shows in the morning, and they'll show a
commercial for a children's compressed breakfast compound such as
"Froot Loops" or "Lucky Charms", and they always show it sitting on a
table next to some actual food such as eggs, and the announcer always
says: "Part of this complete breakfast".  Don't that really mean,
"Adjacent to this complete breakfast", or "On the same table as this
complete breakfast"?  And couldn't they make essentially the same claim
if, instead of Froot Loops, they put a can of shaving cream there, or a
dead bat?

Answer: Yes.
                -- Dave Barry, "Tips for Writer's"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to