[Moscow.pm] Энтити в UTF - как?

Sergiy Borodych sergiy.borodych на gmail.com
Пт Ноя 25 11:18:55 PST 2011


2011/11/25 Alex Povolotsky <tarkhil на over.ru>:
> On 11/25/11 18:13, Alexey Shrub wrote:
>>
>> http://stackoverflow.com/questions/576095/how-can-i-decode-html-entities
>>
>> так?
>
> ПОЧТИ.
>
> Почему-то
>
> perl -MHTML::Entities -e 'while(<>) { print
> HTML::Entities::decode_entities($_); }' importcouponweb >
> importcouponweb.xml
>

видимо нехватает
binmode(STDOUT, ":encoding(UTF-8)"); # или просто :utf-8 чтоб без конверта

> ругается на wide character in print, выдает нечто, что less показывает, как
> текстовый файл, а emacs (внезапно) - как \символы, и пишет предупреждение -
>
> Warning (emacs): File contents detected as raw-text.
>  Consider adding an encoding attribute to the xml declaration,
>  or saving as utf-8, as mandated by the xml specification.

а здесь возможно дело в BOM
https://en.wikipedia.org/wiki/Byte_order_mark

-- 
Sergiy Borodych


Подробная информация о списке рассылки Moscow-pm