MicroDroid / vue-materialize-datatable

A fancy Materialize CSS datatable VueJS component.
https://overcoder.dev/vue-materialize-datatable
MIT License
179 stars 67 forks source link

Exporting options for Cyrillic? #66

Closed WhatNot911 closed 3 years ago

WhatNot911 commented 3 years ago

image This is what I get instead of Cyrillic. Appears to be encoding error or something. Are there any export settings beyond "exportable" ? Or is it not even VMD issue?

MicroDroid commented 3 years ago

Most likely font issues on your end, not sure though

WhatNot911 commented 3 years ago

Maybe. But I figured a way to "hackfix" i I guess. This requires editing DataTable.vue file's method exportExcel();

original piece of code on line 321: const html = this.renderTable().replace(/ /g, '%20'); changing this to const html = ('<head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta LANG="ru"><meta charset="utf-8"></head>' + this.renderTable()).replace(/ /g, '%20'); causes all xls files to display proper cyrillic (or at least Russian) words. I don't know how useful this is but I decided to leave this here anyways.

MicroDroid commented 3 years ago

Ah you didn't even mention that this was in the spreadsheet export and not the table.

Then yes, well hm, can you open a PR?

WhatNot911 commented 3 years ago

Oh sorry, I didn't know there were more than one way to export the table. Anyway I'm not that savvy to know how to open an RP or what it really is, or how to do it properly. I mean hardcoding in meta tags doesn't seem to be a right solution for this "lesser issue". I'd rather close this Untill I figure out how to do this properly (or when someone else does this the right way), I'm not putting my low programming skills in this package, what if I break something? Anyways thanks for the feedback.