Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The export of Chinese data become messy code #8598

Closed
CharlesLdy opened this issue Oct 9, 2016 · 8 comments
Closed

The export of Chinese data become messy code #8598

CharlesLdy opened this issue Oct 9, 2016 · 8 comments

Comments

@CharlesLdy
Copy link

Kibana version: 4.5.4

I export the chinese data by the raw or formatted link. but the chinese become messy code.

@CharlesLdy CharlesLdy changed the title The export of Chinese data is messy code The export of Chinese data become messy code Oct 9, 2016
@Bargs
Copy link
Contributor

Bargs commented Oct 10, 2016

Could you provide an example data set or steps to reproduce?

@CharlesLdy
Copy link
Author

CharlesLdy commented Oct 11, 2016

@Bargs Thanks for your attention.

  1. at first I got the data set with kibana.
    image
  2. second I export the data to csv by raw link or formatted link
    image
  3. then open the csv file, the result is like the picture below
    image

@Bargs
Copy link
Contributor

Bargs commented Oct 11, 2016

@LeeDr you looked into an issue like this before right? Didn't it end up being an issue with the encoding format excel tried by default or something like that?

@LeeDr
Copy link

LeeDr commented Oct 11, 2016

Here's my note from https://discuss.elastic.co/t/resolved-korean-text-is-broken-when-open-the-exported-csv-with-excel/53436/4

Instead of just clicking the csv to open with Excel,
open Excel and use Data > Get External Data > From File and check that the
File origin is 65001: Unicode (UTF-8)

@CharlesLdy
Copy link
Author

CharlesLdy commented Oct 12, 2016

@LeeDr @Bargs
It works by this way. But I don't know how it works, and I think the others maybe encounter this kind of problem. Is there a better way to export the Unicode data?

No matter what ,thanks a lot for your help

@Bargs
Copy link
Contributor

Bargs commented Oct 12, 2016

I don't have excel myself but from some quick googling it doesn't seem like excel handles any Unicode format well. http://stackoverflow.com/questions/6588068/which-encoding-opens-csv-files-correctly-with-excel-on-both-mac-and-windows

If you can find a format that works well though, we'd be happy to look into implementing it. Otherwise, perhaps we could st least add some help text with Lee's instructions on importing.

@LeeDr
Copy link

LeeDr commented Oct 12, 2016

Here's an article with a lot of comments describing that if you put a UTF8 Byte-Order Mark (BOM) of \uFEFF at the very beginning of the CSV some versions of Excel will open it properly. There's a lot of back and forth in the comments about it working or not working on various versions of Excel, or it needing to be tab-separated instead of comma.

https://stackoverflow.com/questions/6002256/is-it-possible-to-force-excel-recognize-utf-8-csv-files-automatically

I did some testing and think we should be adding the BOM when we write CSV export files from Kibana. I created this new issue so I'll close this one;
#8637

@LeeDr LeeDr closed this as completed Oct 12, 2016
@Bargs
Copy link
Contributor

Bargs commented Oct 12, 2016

Awesome detail, thanks @LeeDr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants