W
wing328hk
Hi,
I'm using Text::Wrap and Unicode and found that the function wrap
doesn't handle unicode properly.
Unicode character is double-byte and it seems that wrap basically uses
the function length, which basically return the number of bytes stored
in a variable, to decide where to wrap the input.
For example, say column is 10 and consider the following
aXXXXX where X is a double-byte character
The last unicode X will be corrupted by wrap, which will split the last
unicode character, the 10th and 11th byte of the string, into two.
Does anyone know how to configure wrap such that it works properly with
unicode?
Thanks,
Wing
I'm using Text::Wrap and Unicode and found that the function wrap
doesn't handle unicode properly.
Unicode character is double-byte and it seems that wrap basically uses
the function length, which basically return the number of bytes stored
in a variable, to decide where to wrap the input.
For example, say column is 10 and consider the following
aXXXXX where X is a double-byte character
The last unicode X will be corrupted by wrap, which will split the last
unicode character, the 10th and 11th byte of the string, into two.
Does anyone know how to configure wrap such that it works properly with
unicode?
Thanks,
Wing