Encode

Encode

DavidsonDavidson Posts: 4Questions: 1Answers: 0

Hello. I am interested in, if it is possible to force encoding for CSV button ANSI, while document has UTF-8?
Reasone, that Excell do not recognize UTF-8 by default, so we got something like "Экран". Same time opening this file in Notepad++ is OK.

This question has an accepted answers - jump to answer

Answers

  • DavidsonDavidson Posts: 4Questions: 1Answers: 0

    Comments: l read all possible info here and used "charset: false, "sCharSet: 'ANSI" - none of thees helped

  • allanallan Posts: 61,849Questions: 1Answers: 10,134 Site admin

    No sorry. Buttons will not change character sets. You would need to use a character set conversion library if that is what you want to do.

    that Excell do not recognize UTF-8 by default

    I've never had any problems with it. Can you link to a test case please.

    Allan

  • DavidsonDavidson Posts: 4Questions: 1Answers: 0

    Allan, sorry for delay.
    Please, go ditoys.ru/wp-admin/options-general.php?page=neverpo-top-level-menu-page. You will need: n349778 and 0-0=0.
    Be carefull - you are admin, site is draft and on your command i will delete user n349778.
    Ok, now push the button Export CSV. Save file and open it with MS Excell. As soon as we have some russian text inside the table - we have wrong symbols inside the CSV opened WITH MS Excell. See screenshot.

  • allanallan Posts: 61,849Questions: 1Answers: 10,134 Site admin
    Answer ✓

    If you use the excelHtml5 button type what happens then?

    I've just tried downloading the CSV file from your site and can confirm that I see the same behaviour as yourself, but I believe that this is because Excel is not reading the CSV file as UTF-8, rather than the file not being valid. If you have a look at the file in a text Editor you will be able to see that it is valid UTF-8 and it does display correctly. Copying from the text editor into Excel also works

    It might be that Excel requires the UTF-8 BOM, but that is more an error in Excel - I think its native format is UTF16-LE if I recall correctly.

    There isn't much I can do about that I'm afraid. As I say though, try using the Excel button types.

    Allan

  • DavidsonDavidson Posts: 4Questions: 1Answers: 0

    excelHtml5 - is ok. This is it. Thank you, Allan.

This discussion has been closed.