[rt-users] Output encoding, Web vs CLI

Emmanuel Lacour elacour at easter-eggs.com
Fri Apr 3 06:19:27 EDT 2009


Hi all,

when I run a script using RT::Interface::CLI, everything I get (such as
a CF value or correspondance) is ISO-8859-1. Same code in a mason
template in share/html give UTF-8.

Do I miss some initialization in myu script to get UTF-8?


-----script---
#!/usr/bin/perl -w
# Extract customfields

use strict;
use lib "/home/rt/rt/lib";
use RT;
use RT::Interface::CLI qw( CleanEnv GetCurrentUser );
use RT::User;

# RT CLI initialization
CleanEnv();
RT::LoadConfig();
RT::Init();

# Get the current user all loaded
our $CurrentUser = GetCurrentUser();


my $ticket = RT::Ticket->new( $CurrentUser);
$ticket->Load(13595);
if ((my $values = $ticket->CustomFieldValues ('essai')))
{
   print $values->First->Content."\n";
}
-------------


-------Mason----
<%INIT>
my $ticket = RT::Ticket->new( $CurrentUser);
$ticket->Load(13595);
my $values = $ticket->CustomFieldValues ('essai');
</%INIT>
<% $values->First->Content %>
----------------




More information about the rt-users mailing list