[TxMt] Unicode Bug in "Insert as Snippet"
Hans-Jörg Bibiko
bibiko at eva.mpg.de
Wed Mar 12 20:43:21 UTC 2008
Hi,
if one writes a tmcommand which should write unicode characters (ucs
hex code large than 0xFFFF) via "Insert as Snippet" the output is wrong.
It is not easy to reproduce it caused by the font problem but doable.
-create a new tmcommand
-write echo "
-open Character Palette; go to View: Code Tables; browse to Unicode
00020000 CJK Unified Ideographs Ext. B; scroll the glyph window to
code point 20050 (column 0); double-click on it to insert into the
tmcommand
-write after the inserted character a "
[if you have such a font you should see this:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unicode_bug.tiff
Type: image/tiff
Size: 53832 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20080312/06977116/attachment.tiff>
-------------- next part --------------
otherwise you see a square or whatever.]
-set the output of the tmcommand to 'Insert as Snippet'
If you invoke that command instead of the Chinese character you will
see a simple 'P'.
If you set the output to 'Insert as Text' you will see the correct
character (if you have the font ;)
Why a 'P'? Answer: This character has the UCS code point 0x20050.
Insert as Snippet ignores the leading 2 and will insert 0x0050. And
0x50 is a 'P'.
One can do it for all characters beginning from 0x10000 up. Always
the same.
I know, this bug is more or less marginal but at least for me it's
important ? it's my job ;)
Cheers,
Hans
More information about the textmate
mailing list