PATCH [perl #72624] charnames::viacode(0) returns undef
The viacode() function contained the code from the _getcode() function from
Unicode::UCD, unchanged. However, the rest of viacode() requires that
the result be specially formatted to do a string match with leading
zeros inserted to bring the length up to 4 if less than that. The
original function only needs to get the number right, as a numerical
comparison is done, so it doesn't do this. This showed up with calling
viacode with 0, but the bug also affected any input that looked like a
hex number, or a U+ number, such as 'BEE' or 'U+EF'. These need to be
massaged into '0BEE' and '00EF' for the pattern match later in the
routine to succeed.
The patch also adds a test case to Unicode::UCD to verify that it really
does work ok on 0.