3

I need to export gpkg layer contained Cyrillic characters to a spreadsheet, e.g. csv file. I do that using Export -> Save Features As and pick UTF-8 encoding. I tried encodings: Cyrillic, different UTF's but nothing works. Just UTF 16LE keeps very few Cyrillic words. I also tried to find encoding in Advanced Settings according to an answer from here but it is not available in QGIS 3.16: enter image description here Does anyone know how to fix?

1 Answer 1

2

I tried it and indeed, exporting to CSV does not preserve the cyrillic characters. But when you export in QGIS from geopackage to MS Office Open XML table, the characters are kept: see my screenshot with (left) the attribute table in QGIS and (right) the exported Excel file opened in Excel.

When I export this file again from Excel to CSV, again the cyrillic characters are not preserved. See below the screenshot for this. But as I understand you, you need any file format that you can use in Excel, so exporting to another format should work fine.

enter image description here

This here explains the problem with using CSV for cyrillic characters and how to solve it: https://stackoverflow.com/a/12097021/13651925

As it is an old answer, here is a screenshot with a current Excel version and a test for the CSV exported from QGIS, including the import dialog as well as the result: it works! Open an empty file, go to Data tab, import from text, select the saved csv and set UTF-8 (if not already selected). See screenshot with changed names for the numbers ;-)

enter image description here

7
  • Thank you so much, you got me right! I just didn't expect it is possible to export a table directly to a spreadsheet. Dec 17, 2020 at 13:03
  • It's always good to ask, so I learned something as well about csv encoding problems, I was not aware of it. Luckily, there was already someone out there with a similar problem.
    – Babel
    Dec 17, 2020 at 13:05
  • Should I change the title of this question to avoid misunderstanding, how do you think? Dec 17, 2020 at 13:07
  • "When I export this file again from Excel to csv, again the cyrillic characters are not preserved." - I tried to save xlsx to csv, and everything preserved. Probably you can try to configure your MS Excel? Dec 17, 2020 at 13:13
  • I don't think it's necessary to change the title, however, you are free to do it. What would you change?
    – Babel
    Dec 17, 2020 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.