[rt-users] Output encoding, Web vs CLI
Jesse Vincent
jesse at bestpractical.com
Fri Apr 3 10:09:48 EDT 2009
On Fri, Apr 03, 2009 at 12:19:27PM +0200, Emmanuel Lacour wrote:
> 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?
I have a sneaking suspicion this is related to Locale::Maketext::Lexicon
being "smart"
What have you set your environment/locale to in that shell?
Can you reduce this to a test we can drop into the RT test suite?
>
>
> -----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 %>
> ----------------
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
--
More information about the rt-users
mailing list