in reply to Re: length() miscounting UTF8 characters?
in thread length() miscounting UTF8 characters?
Yes, I'm piping the textfile into the script, though that's more for convenience than anything else. It'd be easy enough to change.
I read up on the open pragma again and noticed that it can be fed another subpragma, :std, to affect the STD* streams:
The :std subpragma on its own has no effect, but if combined with the :utf8 or :encoding subpragmas, it converts the standard filehandles (STDIN, STDOUT, STDERR) to comply with encoding selected for input/output handles. For example, if both input and out are chosen to be :encoding(utf8) , a :std will mean that STDIN, STDOUT, and STDERR are also in :encoding(utf8) .
So I tried changing that line to
use open IO => ':std', ':utf8';
but that didn't make a difference either. I'm probably still missing something fairly obvious.
Thanks for your help, by the way!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: length() miscounting UTF8 characters?
by choroba (Cardinal) on Apr 27, 2014 at 22:51 UTC | |
by AppleFritter (Vicar) on Apr 27, 2014 at 22:59 UTC | |
by choroba (Cardinal) on Apr 27, 2014 at 23:06 UTC |