On Wednesday, December 17, 2014, Marek Stepanek <[email protected]> wrote:


Hello all!


I need to replace many emoticons in a large xelatex-file. I have had the
intention to make a perl-filter like follows

while(<>){
s/\x3DD818DE/pix/emo01.jpg/g
etc etc
}

but already the search in BBEdit for the hexcode did not succeeded.

I made a file with two emoticons:

😘 🚕

Separated by spaces. The hexdump gave:

0000: 20 00 3D D8 18 DE 20 00 3D D8 95 DE 20 00            .=... .=... .

When you hex dump an open document from memory, you are seeing the actual byte order as it is used by the computer. On Intel machines, this is reversed from Unicode, so a space U+0020 will dump as 20 00 as you see there.

I searched for the icons first. No success. Then I tried to find the
space. Apparently the space is 20 00. I searched for \x{2000} grep
turned on. Right? No success! There is something obvious I missed.

When using escapes in the Find window, use the actual Unicode code point. So, search for \x{0020} and you will get your desired result.

The code points of the icons I found with "Special Characters" under the
Menu "Edit":

Kiss: U+1F618 (U+D83D U+DE18) UTF-8: F0 9F 98 98
Taxi: U+1F695 (U+D83D U+DE95) UTF-8: F0 9F 9A 95

My Question: how to find with hexcode in general and these icons in
special.

BBEdit stores everything as UTF-16, so you won't be able to find what you're searching for by using U+1F618. Instead, try searching for the combining code points and see if that works: \x{D83D}\x{DE18}, for example.

R.
--
Rich Siegel                                 Bare Bones Software, Inc.
<[email protected]>                      <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to