> Isn't anyone using this feature? How?
> I have a selection, like this string:
> "remove"
> (including the quote marks).
> I use the command
> Markup > Utilities > Translate...
> which is set to
> -text to HTML
> -HTML entitites
> -Name
> -Selection Only
>
> and when I hit the 'translate' button, then *nothing* happens.
> I want it to replace my selection with
> "remove"
Translate doesn't translate " -> "e; because it is in general, not
necessary.
Why do you want to represent quotation marks in entity form?
Jim
>> Why do you want to represent quotation marks in entity form?
>
> when it becomes a value for a form <input>
> for example.
It is not currently possible to have the HTML Translate too
automatically encode double quotes.
If you use the HTML Markup tools (in this case the Input editor)
double quotes should automatically be encoded in your input. There is
bug which prevents this from happening in certain situations - I'll
fix it for a future release.
If you are typing code by hand, an even faster solution than typing
the entities would be to wrap your attribute value in single quotes.
For example
<input name="some_name" value='"some value"' />
(I'll log a feature request so we can consider offering purpose built
entity encoding tools which solve this need separate from the
translate utility.)
Jim
>> when it becomes a value for a form <input>
>> for example.
>
> It is not currently possible to have the HTML Translate too
> automatically encode double quotes.
Govinda:
As a workaround you could use a Perl script to convert the current
selection to entities and save it as a Unix Filter in BBEdit. For
example, I use this script (saved to ~/Library/Application Support/
BBEdit/Unix Support/Unix Filters/Convert to HTML Entities.pl):
-----
#!/usr/bin/perl -w
use CGI;
while (<>)
{
print CGI::escapeHTML($_);
}
-----
Assign a nice keyboard shortcut (I like Control-Command-E) and you're
all set. Hope this helps.
-Dennis
>(I'll log a feature request so we can consider offering purpose built
>entity encoding tools which solve this need separate from the
>translate utility.)
While you are at it, I'd like to suggest a 4th check box at the
bottom of the Format Menu Options area that would convert all Unicode
entries over u+00ff to encoded entries (like the translate does now)
WHEN the Charset is NOT UTF8/UTF16 and there are High Ascii
characters. Also, I would like to have a way of having any x80-x9F
characters converted to encoded (or Unicode if Charset=UTF=8) if
Charset is ISO-8859-1 (since they are ONLY valid for Windows-1252 and
should be replaced with their 8xxx Unicode values). This will handle
the use of non-ISO-8859-1 Characters which normally trigger the "MUST
SAVE AS UTF-8" error message.
--
Robert A. Rosenberg
RAR Programming Systems Ltd.
(845)-357-0931 - Home
(646)-479-1984 - Cell Phone
(646)-349-4025 - Fax
Perhaps this will be of interest:
<http://daringfireball.net/projects/smartypants/>