when site uses utf-8 encoding, yml though must be in win 1251.
now .yml file has in header with unrecoverable wrong converted russian characters in .yml body:
<category id="25" parentid=">22">��������� MOSAIC</category>
<category id="16" parentid=">0">����������������� ����� � ����</category>
by replace
echo yml_convert_to_1251(theme('yml_products', $nodes, $categories), 'utf-8');
in line 127 of yml_export.module with
echo theme('yml_products', $nodes, $categories)
you can obtain correct and unusefull utf-8 encoded file, instead of win-1251
Comments
Comment #1
com_net commentedsorry, should read:
...yml file has utf-8 charset in header...
Comment #2
restyler commentedThe yml files generated with Yandex export are perfectly valid for Yandex.market.
The module uses win1251 because of historical reasons (Yandex market didn't like utf8 files during validation process - now that's fixed on their side).
When I have more time, I will remove win1251 encoding from the module as it's not neccessary anymore.
Comment #3
com_net commented1251 is the only encoding acceptable by Yandex market.
Yandex market does not work with utf-8.
YML file generated by module is NOT in win 1251 - it is in utf-8 (site default) with wrong header.
The first string of yml_products.tpl.php should be
<?php header('Content-type: application/xhtml+xml; charset=windows-1251');?>instead of
<?php echo "<?xml version=\"1.0\" encoding=\"windows-1251\"?>\n" ?>Comment #4
restyler commentedThat is not true - I've just changed the module to work with utf-8, here is the yandex.market file check result: http://pix.am/krg0.png
it looks like utf8 is fine for market now.
Please check the latest .dev of the module (that will be generated in several hours) on your shop to see if you get any problems with new utf8 approach.
that is not true, either. the module encodes its output to win1251. (to be more correct, it encoded until now - I've just removed all the utf8->win1251 encoding logic from the module, we're pure utf8 now!). Yes, there were some problems with headers, though - which caused the problem with user browsers, opening the generated .xml, but not with yandex market parsing robot.
I think you are have problems understanding what is the difference between header() and echo "<?xml" strings that you've mentioned above. That is completely different things, we can't put one thing _instead_ of other. I've added header() call to specify correct content type and encoding now, though - thanks.
Comment #5
restyler commentedComment #6
com_net commentedif you have both header and xml type declaration in yml_products.tpl.php - you will get an error "duplicate XML declaration" on preview yml_products.xml