$html = encode_pictogram($rawtext); $html = encode_pictogram($rawtext, unicode => 1);
Encodes pictogram characters in raw-text into HTML entities. If $rawtext contains extended pictograms, they are encoded in Unicode format. If you add unicode option explicitly, all pictogram characters are encoded in Unicode format (). Otherwise, encoding is done in decimal format (NNNNN;).
$rawtext = decode_pictogram($html);
Decodes HTML entities (both for and NNNNN;) for pictogram into raw-text in Shift_JIS.
$cleantext = remove_pictogram($rawtext);
Removes pictogram characters in raw-text.
$num_found = find_pictorgram($rawtext, \&callback);
Finds pictogram characters in raw-text and executes callback when found. It returns the total numbers of charcters found in text.
The callback is given three arguments. The first is a found pictogram character itself, and the second is a decimal number which represents Shift_JIS codepoint of the character. The third is a Unicode codepoint. Whatever the callback returns will replace the original text.
Here is a stub implementation of encode_pictogram(), which will be the good example for the usage of find_pictogram(). Note that this example version doesnt support extended pictograms.
o This module works so slow, because regex used here matches ANY characters in the text. This is due to the difficulty of extracting character boundaries of Shift_JIS encoding. o Extended pictogram support of this module is not complete. If you handle pictogram characters in Unicode, try Encode module with perl 5.8.0, or Unicode::Japanese.
Tatsuhiko Miyagawa <firstname.lastname@example.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||HTML::ENTITIES::IMODEPICTOGRAM (3)||2003-06-23|