Changeset 23285 for main/trunk/greenstone2/perllib/unicode.pm
- Timestamp:
- 2010-11-03T17:52:09+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/unicode.pm
r18410 r23285 701 701 } 702 702 703 # Useful method to print UTF8 (or other unicode) for debugging. 704 # Characters that are easily displayed (that is, printable ASCII) 705 # are shown as-is, whereas hex values of the unicode code points 706 # are shown for all other chars. 707 sub debug_unicode_string 708 { 709 join("", 710 map { $_ > 128 ? # if wide character... 711 sprintf("\\x{%04X}", $_) : # \x{...} 712 chr($_) 713 } unpack("U*", $_[0])); # unpack Unicode characters 714 } 703 715 704 716 1;
Note:
See TracChangeset
for help on using the changeset viewer.