Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
341 B

  1. #!/usr/bin/env perl
  2. use warnings;
  3. use strict;
  4. use Encode;
  5. use 5.10.0;
  6. while (<>) {
  7. say "length of raw input: " . length $_;
  8. my $decoded = decode('UTF-8', $_);
  9. say "length of decoded input: " . length $decoded;
  10. say "encoded() on decoded input: " . encode('UTF-8', $decoded);
  11. say "encode() on raw input: " . encode('UTF-8', $_);
  12. }