This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
uvoffuni_to_utf8_flags() die if platform can't handle
On non EBCDIC platforms currently any UV is encodable as UTF-8. (This
would change if there were 128-bit words). Thus, much code assumes that
nothing can go wrong when converting to UTF-8, and hence does no error
checking.
However, UTF-EBCDIC is only capable of representing code points below
2**32, so if there are 64-bit words, this function can fail.
Prior to this patch, there was no real overflow check, and garbage was
returned by this function if called with too large a number.
While not ideal, the easiest thing to do is to just die for such a
number, like we do for division by 0. This involves changing only code
within this function, and not its many callers.