A
A
Anton2018-06-27 15:53:01
PHP
Anton, 2018-06-27 15:53:01

How to specify encoding?

There is this code:

$strTmpOff.= 
"<g:description>".
yandex_text2xml(TruncateText(
($arAcc["PREVIEW_TEXT_TYPE"]=="html"? 
strip_tags(preg_replace_callback("'&[^;]*;'", "replace_special", 
$arAcc["~PREVIEW_TEXT"])) : $arAcc["PREVIEW_TEXT"].'Товар
 сертифицирован. Доставка по всей России.'),
3000), true).
"</g:description>\n";

I need to add utf-8 indication to the top code as in the code below:
$strTmpOff.= "<g:title>".htmlspecialchars($APPLICATION->
ConvertCharset($arAcc[NAME], LANG_CHARSET, 'utf-8'))."</g:title>\n";

Apparently I'm adding it incorrectly, since errors appear during the formation of the feed.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question