[Solved] Export values with accent (PT-BR ISO-8859-1) to CSV

Moderator: crythias

Post Reply
amdkryn
OTRS wizard
Posts: 185
Joined: 02 Oct 2012, 02:52
OTRS Version?: 5.0.27

[Solved] Export values with accent (PT-BR ISO-8859-1) to CSV

Post by amdkryn » 01 Aug 2013, 18:46

Hi!

I need to export values with accent (ã, õ, á,ó...) to CSV
file from OTRS Survey, but isn't possible.

Link for example:
http://server/otrs/index.pl?Action=Agen ... SurveyID=2

Each column that has accent is truncated in file exported.

How can i change the character encoding from the export model to
ISO-8859-1?

Files module for package - Survey CSV Export
Kernel/Config/Files/SurveyExport.xml
Kernel/Modules/AgentSurveyExport.pm
Custom/Kernel/Modules/AgentSurveyZoom.pm
Kernel/Output/HTML/Standard/AgentSurveyZoomExport.dtl

Any help is appreciated...
Thanks
Last edited by amdkryn on 22 Mar 2014, 23:40, edited 2 times in total.
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.

reneeb
OTRS guru
Posts: 4795
Joined: 13 Mar 2011, 09:54
OTRS Version?: 3.3.x
Company: Perl-Services.de
Contact:

Re: Export values with accent to CSV - Help

Post by reneeb » 01 Aug 2013, 23:16

What's the encoding of your DB?
For the future: You should say which add ons you have installed. The export is neither standard OTRS nor part of the Survey add on. It's an extra add on available on OPAR.


The module sets "utf-8" as the charset in Kernel/Modules/AgentSurveyExport.pm. Search for "Attachment(". Change the utf-8 to iso-8859-1. Please keep us informed whether this fixes your problem.
Perl / OTRS development: http://perl-services.de
Free OTRS add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de

amdkryn
OTRS wizard
Posts: 185
Joined: 02 Oct 2012, 02:52
OTRS Version?: 5.0.27

Re: Export values with accent to CSV - Help

Post by amdkryn » 02 Aug 2013, 02:18

I do not sure, I believe that is the default.
A consultant had already corrected other reports, but this has not yet and I want to learn to solve.

I changed the quoted text did not work. Any other suggestions?
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.

Mike_B
Moderator
Posts: 266
Joined: 12 Jan 2010, 18:16
OTRS Version?: CVS HEAD

Re: Export values with accent to CSV - Help

Post by Mike_B » 02 Aug 2013, 11:08

There was a byte-order-mark in the CSV export; see here for the fix (and let me know if it works for you!!)
https://github.com/tuxwerk/OTRS-SurveyExport/pull/1
huntingbears.nl - @michielbeijen on Twitter

amdkryn
OTRS wizard
Posts: 185
Joined: 02 Oct 2012, 02:52
OTRS Version?: 5.0.27

Re: Export values with accent to CSV - Help

Post by amdkryn » 02 Aug 2013, 18:08

I copied the code and saved in place of the original but the accents do not work yet. Any other tips?
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.

amdkryn
OTRS wizard
Posts: 185
Joined: 02 Oct 2012, 02:52
OTRS Version?: 5.0.27

Re: Export values with accent to CSV - Help

Post by amdkryn » 20 Aug 2013, 20:59

amdkryn wrote:I copied the code and saved in place of the original but the accents do not work yet. Any other tips?
Someone?
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.

amdkryn
OTRS wizard
Posts: 185
Joined: 02 Oct 2012, 02:52
OTRS Version?: 5.0.27

Re: Export values with accent to CSV - Help

Post by amdkryn » 06 Sep 2013, 16:00

BUMP :)
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.

amdkryn
OTRS wizard
Posts: 185
Joined: 02 Oct 2012, 02:52
OTRS Version?: 5.0.27

Re: Export values with accent to CSV - Help

Post by amdkryn » 19 Mar 2014, 14:02

For those interested, the problem of exporting the report with accents (PT-BR) was solved with the following configuration (/opt/otrs/Custom/Kernel/Modules/AgentSurveyExport.pm):


Under "user Kernel ::System::HTMLUtils;" add "use Encode;" and in line 110, change as code below:

Code: Select all

    return $Self->{LayoutObject}->Attachment(
	Filename    => "survey.csv",
	ContentType => "text/csv",
	Content     => encode("iso-8859-1",$CSV),
    );
}

1;
[/b]

Fuçando nos meus sistemas encontrei como foi configurado o AgentSurveyExport.pm, precisa adicionar o "use Encode;" no inicio do arquivo pra usar essa função e a partir da linha 110 alterar o código conforme exemplo acima em inglês.
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.

Post Reply