[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?

#!/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

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

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

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

More information about the rt-users mailing list