File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 25
25
$ test_kddi = "Hello " .utf8_bytes (0xE490 );
26
26
$ test_google = "Hello " .utf8_bytes (0xFE02C );
27
27
28
- $ test_html = "Hello <span class= \" emoji-outer emoji-sizer \" ><span class= \" emoji-inner emoji2649 \" ></span></span> " ;
28
+ $ test_html = "Hello " . test_html ( 2649 ) ;
29
29
30
30
is (emoji_docomo_to_unified ($ test_docomo ), $ test_unified , "DoCoMo -> Unified " );
31
31
is (emoji_kddi_to_unified ($ test_kddi ), $ test_unified , "KDDI -> Unified " );
105
105
is (emoji_contains_emoji ('hello world ' ), false , "does not contain emoji " );
106
106
107
107
108
+ echo "#------------------ \n" ;
109
+
110
+
111
+ #
112
+ # deal with modifiers correctly
113
+ #
114
+
115
+ is (emoji_unified_to_html ("\xE2\x9D\xA4" ), test_html ('2764 ' ), "no modifier " );
116
+ is (emoji_unified_to_html ("\xE2\x9D\xA4\xEF\xB8\x8F" ), test_html ('2764 ' ), "image modifier " );
117
+ is (emoji_unified_to_html ("\xE2\x9D\xA4\xEF\xB8\x8E" ), "\xE2\x9D\xA4\xEF\xB8\x8E" , "text modifier " );
118
+
108
119
109
120
110
121
#
@@ -168,3 +179,7 @@ function utf8_bytes($cp){
168
179
return chr ($ cp );
169
180
}
170
181
}
182
+
183
+ function test_html ($ codepoint ){
184
+ return "<span class= \"emoji-outer emoji-sizer \"><span class= \"emoji-inner emoji {$ codepoint }\"></span></span> " ;
185
+ }
You can’t perform that action at this time.
0 commit comments