Advertisement
hakonhagland

macos-ncursesw-locale-test

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