[...]
>Example, instead of replacing the inverted question mark with the Hex
>code: "\xBF" is it possible to have BBEdit replace it with the numeric
>code: "¿"
>
The Translate command (Markup -> Utilities -> Translate, with appropriate
options set) should do what you need.
Regards,
Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048
>DarthPixel <alcone.a...@gmail.com> sez:
>
>[...]
>>Example, instead of replacing the inverted question mark with the Hex
>>code: "\xBF" is it possible to have BBEdit replace it with the numeric
>>code: "¿"
>>
>
>The Translate command (Markup -> Utilities -> Translate, with appropriate
>options set) should do what you need.
No it will not. Translate does TXT to HTML and HTML to Text
transformations (and will do the code changes when it goes to HTML).
It does NOT take HTML and output HTML with the codes altered (ie: It
will not take an HTML file and just alter the entries to
&named/&hex/&decimal).
--
Robert A. Rosenberg
RAR Programming Systems Ltd.
(845)-357-0931 - Home
(646)-479-1984 - Cell Phone
(646)-349-4025 - Fax
Sorry, I ought to've been more specific. :-)
You can use the Translate command for this purpose as follows: select
"Translate: Text to HTML", with the "Paragraphs" option turned OFF, and the
"Ignore < and >" option turned ON.
Now, when you apply this command to an HTML file, BBEdit will process the
file's contents and convert all extended characters, without affecting its
tags.
>Sorry, I ought to've been more specific.
>
>You can use the Translate command for this purpose as follows: select
>"Translate: Text to HTML", with the "Paragraphs" option turned OFF, and the
>"Ignore < and >" option turned ON.
>
>Now, when you apply this command to an HTML file, BBEdit will process the
>file's contents and convert all extended characters, without affecting its
>tags.
Thank you for the follow-up. I tried this and it works. While I would
rather have this as part of the Format Command, it seems to work as
you stated.
I have two slight areas that I would like to see it enhanced. First
is to have an option to tell it to rescan the HTML entries and
convert them to the current setting. IOW: If I have © but I am
set to decimal have it alter to ©. Second, give it the ability
to fix invalid x80-x9F codes so they are the correct Unicode
equivalents. I note that if I use the character itself, the Unicode
value is used for the replacement so that is working already but
unless you add the rescan there is no way to fix/correct any usage of
the invalid values except manually.
When I look for "ver" I want to find verse, v�rbo and v�rso and not
only the unaccented forms, not to speak of Greek.
So far as I can see BBEdit is not able to do such searches and this
seems to be a serious deficiency. There must be a standard algorithm
for such searches -- Google must use one. Have I missed something,
and if not, are there any plans to allow a diacritic-blind search?
JD
The normal way to do that is to put [=e=] inside a grep character class, like « v[[=e=]]r », but when I tried that just now in BBEdit, I got a message "The search cannot proceed, because of a syntax error in the Grep pattern: POSIX collating elements are not supported...".
To see this in action, try the command line command
echo 'xyz\nEh?\nélève\nabc\nêtre\nest\net' | grep '[[=e=]]'
or similar.
Greg Shenaut
>The normal way to do that is to put [=e=] inside a grep character
>class, like ÔøΩ v[[=e=]]r ÔøΩ, but when I tried that just now in BBEdit,
>I got a message "The search cannot proceed, because of a syntax
>error in the Grep pattern: POSIX collating elements are not
>supported...".
I wasn't aware of that trick. Thank you. I thought at least I'd be
able to get round it by writing a Unix filter in Perl, but that too
gives this error:
POSIX syntax [= =] is reserved for future extensions in regex;
and that's using Perl 5.12.0
So what's the deal with these POSIX extensions?
Surely our friends at Barebones are not going to be intimidated?!
JD