Hi,
Is there some way to extract a substring in any encoding, ensuring that
valid chars are always extracted?
setlocale(LC_CTYPE, "$locale");
$string = "some_multibyte_or_bidi_string";
$extracted_chars = substr($string, x, y);
is there some magic value for x & y which will work for all encodings?
(I don't care what the offset is once it's >0, nor how long the string
is once it's a valid string of chars contained in $string).
Even better, is there some i18n perl function which would do this
reliably?
thanks,
mags.