ArchiveOrangemail archive

Moscow.pm group


moscow-pm.pm.org
(List home) (Recent threads) (139 other Perl Mongers lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Moderate traffic list: up to 30 messages per day
  • This list contains about 15,799 messages, beginning Nov 2007
  • 6 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

Кроссплатформен ность и кодировка

Ad
Alexandr Alexeev 1339841838Sat, 16 Jun 2012 10:17:18 +0000 (UTC)
Есть скрипт, который выводит что-то в консоль. В этом что-то помимо прочего
есть UTF.

А что, если у пользователя LANG=ru_RU.KOI8-R ? Или если он под виндой и у
него CP-1251 (или что там в виндовой консоли)? Чем можно автоматически
конвертировать кодировку при вводе-выводе?
Maxim Vuets 1339842478Sat, 16 Jun 2012 10:27:58 +0000 (UTC)
2012/6/16 Alexandr Alexeev :

> А что, если у пользователя LANG=ru_RU.KOI8-R ? Или если он под виндой и у
> него CP-1251 (или что там в виндовой консоли)? Чем можно автоматически
> конвертировать кодировку при вводе-выводе?Вероятно, как-то так:

$ LC_ALL=en_GB.UTF-8 perl -Mopen=:locale -E 'say "\x{0436}"'
ж
$ LC_ALL=ru_RU.CP1251 perl -Mopen=:locale -E 'say "\x{0436}"'
æ
$ LC_ALL=ru_RU.CP1251 luit perl -Mopen=:locale -E 'say "\x{0436}"'
ж

SEE ALSO: perldoc open, perldoc encoding-- 
maxim.vuets.name
Alessandro Gorohovski 1339847826Sat, 16 Jun 2012 11:57:06 +0000 (UTC)
Alexandr Alexeev  писал(а) в своём письме Sat, 16 Jun  
2012 13:17:01 +0300:

> Есть скрипт, который выводит что-то в консоль. В этом что-то помимо  
> прочего
> есть UTF.
>
> А что, если у пользователя LANG=ru_RU.KOI8-R ? Или если он под виндой и у
> него CP-1251 (или что там в виндовой консоли)? Чем можно автоматически
> конвертировать кодировку при вводе-выводе?iconv
?

-- 
Alessandro
Home | About | Privacy