Advertisement
hakonhagland

macos-encoding-utf8

Mar 1st, 2022
2,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.40 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use utf8;
  4. use feature qw(say);
  5. use POSIX qw(locale_h);
  6. use locale;
  7. use Curses;
  8. my $old_locale = setlocale(LC_CTYPE);
  9. say "old locale = ", $old_locale;
  10. setlocale(LC_CTYPE, "");
  11. binmode STDOUT, ':encoding(utf-8)';
  12. my $str = 'привет';
  13. printf "%vX\n", $str;
  14. initscr();
  15. noecho();
  16. cbreak();
  17. addstr(0, 0, "testing: $str");
  18. refresh();
  19. my $ch = getch();
  20. endwin();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement