View Issue Details

IDProjectCategoryView StatusLast Update
0011360mantisbtcsvpublic2011-08-05 02:12
Reporterrerbin Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionduplicate 
Product Version1.2.0rc2 
Summary0011360: When i use Chinese language,the exported CSV file can not be displayed correctly in the Microsoft Excel
Description

please see the attachments.

I think maybe there are some charset or encode errors.

I find some infomation from the Chinese web sites to fix the errors:
Modify csv_export.php

add function:

function expChangeCode($str)
{
$str = mb_convert_encoding($str,"CP936","UTF-8");
return $str;
}

Modify three lines of the file csv_export.php

Modify "echo $t_header"
to "echo expChangeCode($t_header);"

Modify "echo $t_value"
to "echo expChangeCode($t_value);"

Modify "echo $t_function( $t_row[ $t_column ] );"
to "echo expChangeCode($t_function( $t_row[ $t_column ] );"

TagsNo tags attached.
Attached Files
csv.png (10,033 bytes)   
csv.png (10,033 bytes)   
xml.png (7,998 bytes)   
xml.png (7,998 bytes)   

Relationships

duplicate of 0009034 closedrombert CSV Export with special chars dont work properly 

Activities

rerbin

rerbin

2010-01-08 02:09

reporter   ~0024087

the CSV Export is wrong,see the file csv.png;the Excel Export is right,see the file xml.png

rerbin

rerbin

2010-01-08 02:12

reporter   ~0024088

both the CSV Export and the Excel Export, when the project name contain the Chinese words the exported file's name is not correctly

rerbin

rerbin

2010-01-08 02:14

reporter   ~0024089

In the attachments,my project name is 完善mantis

rerbin

rerbin

2010-03-02 10:47

reporter   ~0024596

It's important,can anybody do a fix?

squarebox

squarebox

2010-03-02 20:00

reporter   ~0024603

Two comments here... shamelessly bumping your own ticket in hopes more people will see it, is well shameless. There are forums as well, and those are better suited for fast turn-around.

Now, my constructive comment. I'm running a japanese installation and have this problem as well, but the issue may not be a mantis issue but rather an Excel issue. The generated csv file is generated CORRECTLY if you look at it in any other editor besides Excel, i.e. Notepad++ or even basic notepad. That would leave me to believe that excel is expecting some character encoding somewhere and isn't getting it, cause it's a csv file.

Workaround: do a csv export and then rename to the file extension from "csv" to "txt" and open in excel. It should get properly detected as UTF-8 and will render correctly in excel.

squarebox

squarebox

2010-03-02 20:07

reporter   ~0024604

ha... even better this ticket is a duplicate of 0009034
which has a fix if you are having issues with just 1 particular character set