Hi all -
I did a search through the archives but I didn't find an answer on how to accomplish what I'm looking for.
The current method that TextMate uses to escape entities is by using the short name ('), which unfortunately doesn't work with Windows IE. I'm trying to figure out if there's a way to convert these instead to the numeric version (e.g. ’).
Is there any way to do this? Or a bundle that I can install that will do this?
Thanks, Neil
On 2/8/2006, at 19:02, Neil Lee wrote:
The current method that TextMate uses to escape entities is by using the short name ('), which unfortunately doesn't work with Windows IE. I'm trying to figure out if there's a way to convert these instead to the numeric version (e.g. ’).
Press ⌃⌥⌘C (brings up the bundle editor)
Unfold the HTML bundle.
Select the first item (Convert Character / Selection to Entities.)
Change line 11 from:
ent = $char_to_entity[ch]
To:
ent = nil
Then it will never use the symbolic name. You may want to duplicate the command and edit the duplicate, if you want to keep the original one.
Le 06-08-03 à 08:37:12, Allan Odgaard a écrit :
Change line 11 from: ent = $char_to_entity[ch]
To: ent = nil
Thanks, Allan -
I did this and now my character entities are being encoded in hexadecimal, which isn't quite what I was looking for.
For example, the copyright symbol should be © and now it's being converted to ©.
Is there any way to get the decimal equivalents? My understanding is they're the most widely supported.
Thanks,
Neil
* Neil Lee neil@hushboom.com [2006-08-04 09:07]:
Is there any way to get the decimal equivalents? My understanding is they're the most widely supported.
Change "&#x%02X;" in the next line (with sprintf) to "&#%d;".
On 3/8/2006, at 15:43, Neil Lee wrote:
[...] Is there any way to get the decimal equivalents? My understanding is they're the most widely supported.
I would be very surprised if a browser fails to do the hexadecimal version.
But change sprintf("&#x%02X;", ch.unpack("U")[0]) to sprintf("&#%d;", ch.unpack("U")[0]) and it should print decimal entities.