[rt-users] UTF8, MIME::Encoding Subject Line, troubles again/still.

Alexey G Misyurenko mag at caravan.ru
Thu Jan 24 06:33:13 EST 2008


Hi!

Looks like this probles take plase if value of $value variable is mixed,
i.e. exist single byte coded chars and double byte coded chars on it.

-----Исходное сообщение-----
От: Alexey G Misyurenko [mailto:mag at caravan.ru] 
Отправлено: 24 января 2008 г. 13:17
Кому: 'rt-users at lists.bestpractical.com'
Тема: UTF8, MIME::Encoding Subject Line, troubles again/still.

Hi!

I find that 'Subject' field of mail header still encoded to utf8 twice.

Here 'debug trace' of ${RT_PATH}/lib/RT/Action/SendEmail.pm

[Thu Jan 24 09:53:25 2008] [crit]: BEFORE
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:955)
[Thu Jan 24 09:53:25 2008] [crit]: Charset is 'utf-8'.
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:956)
[Thu Jan 24 09:53:25 2008] [crit]: use Jcode;
        my $jcode = Jcode->new($str);
        my @chunks = $jcode->jfold($max,'\n');is '[rtname #43] AutoReply:
РС%Рч Р?Р?РёР? С'РчС?С'РёР?'. (/usr/local/newrt/local/lib/RT/Action/Sen
dEmail.pm:957)
[Thu Jan 24 09:53:25 2008] [crit]: UFT8 flags is ON.
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:960)
[Thu Jan 24 09:53:25 2008] [crit]: String UTF8 format is OK
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:962)
[Thu Jan 24 09:53:25 2008] [crit]: AFTER
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:978)
[Thu Jan 24 09:53:25 2008] [crit]: Charset is 'utf-8'.
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:980)
[Thu Jan 24 09:53:25 2008] [crit]: Value is '[rtname #43] AutoReply:
Г?ВГ'В%Г?Вч Г?В?Г?В?Г?ВёГ?В? Г'В'Г?ВчГ'В?Г'В'Г?ВёГ?В?'.
(/usr/local/newrt/local/lib/
RT/Action/SendEmail.pm:981)
[Thu Jan 24 09:53:25 2008] [crit]: UFT8 flags is OFF.
(/usr/local/newrt/local/lib/RT/Action/SendEmail.pm:992)

Some remarks
BEFORE - mean before 
         sub MIMEEncodeString     
         Line_num 952 ( of original SendMail.pm )
         Line code "Encode::_utf8_off($value);" 

AFTER - mean  after
         sub MIMEEncodeString     
         Line_num 953 ( of original SendMail.pm )
         Line code "my $res = Encode::from_to( $value, "utf-8", $charset );"

Charset - value of variable $charset
Value - values of variable $value


Any Ideas how to correctly fix troubles???


=== some information about RT
Perl v5.8.5 under linux   Apache2::Const v2.000003;  Apache2::Log v2.000003;
Apache2::Module v2.000003;  Apache2::RequestIO v2.000003;
Apache2::RequestRec v2.000003;  Apache2::RequestUtil v2.000003;
Apache2::Response v2.000003;  Apache2::ServerUtil v2.000003;
Apache2::Status v4.00;  Apache::DBI v1.06;  Apache::Session v1.85;
Apache::Session::File v1.54;  Apache::Session::Generate::MD5 v2.1;
Apache::Session::Lock::File v1.04;  Apache::Session::Serialize::Storable
v1.01;  Apache::Session::Store::File v1.03;  APR v0.009000;  APR::Pool
v0.009000;  APR::Table v0.009000;  AutoLoader v5.60;  base v2.06;  bytes
v1.01;  Cache::Simple::TimedExpiry v0.27;  capitalization v0.03;  Carp
v1.03;  CGI v3.33;  CGI::Cookie v1.28;  CGI::Util v1.5;  Class::Container
v0.12;  Class::Data::Inheritable v0.06;  Class::ReturnValue v0.55;  Clone
v0.28;  constant v1.04;  Cwd v3.27;  Data::Dumper v2.121;  Date::Format
v2.22;  Date::Parse v2.27;  DBD::Oracle v1.20;  DBI v1.601;
DBIx::SearchBuilder v1.51;  DBIx::SearchBuilder::Union v0;
DBIx::SearchBuilder::Unique v0.01;  Devel::StackTrace v1.15;
Devel::StackTraceFrame v0.6;  Devel::Symdump v2.08;  Digest::base v1.00;
Digest::MD5 v2.36;  DynaLoader v1.05;  Encode v2.01;  Encode::Alias v2.00;
Encode::Config v2.00;  Encode::Encoding v2.00;  Encode::Guess v2.00;
Encode::Unicode v2.00;  Errno v1.09;  Exception::Class v1.23;
Exception::Class::Base v1.2;  Exporter v5.58;  Exporter::Heavy v5.58;  Fcntl
v1.05;  File::Basename v2.73;  File::Glob v1.03;  File::Path v1.06;
File::Spec v3.27;  File::Spec::Unix v3.27;  File::Temp v0.20;  FileHandle
v2.01;  HTML::Element v3.23;  HTML::Entities v1.35;  HTML::Formatter v2.04;
HTML::FormatText v2.04;  HTML::Mason v1.38;  HTML::Mason::ApacheHandler
v1.69;  HTML::Mason::Exception v1.1;  HTML::Mason::Exception::Abort v1.1;
HTML::Mason::Exception::Compilation v1.1;
HTML::Mason::Exception::Compilation::IncompatibleCompiler v1.1;
HTML::Mason::Exception::Compiler v1.1;  HTML::Mason::Exception::Decline
v1.1;  HTML::Mason::Exception::Params v1.1;  HTML::Mason::Exception::Syntax
v1.1;  HTML::Mason::Exception::System v1.1;
HTML::Mason::Exception::TopLevelNotFound v1.1;
HTML::Mason::Exception::VirtualMethod v1.1;  HTML::Mason::Exceptions v1.43;
HTML::Parser v3.56;  HTML::Scrubber v0.08;  HTML::Tagset v3.10;
HTML::TreeBuilder v3.23;  HTTP::Date v1.47;  I18N::LangTags v0.33;
I18N::LangTags::Detect v1.03;  integer v1.00;  IO v1.23;  IO::File v1.14;
IO::Handle v1.27;  IO::InnerFile v2.110;  IO::Lines v2.110;  IO::ScalarArray
v2.110;  IO::Seekable v1.1;  IO::WrapTie v2.110;  IPC::Open2 v1.01;
IPC::Open3 v1.0106;  lib v0.5565;  List::Util v1.19;  Locale::Maketext
v1.09;  Locale::Maketext::Fuzzy v0.10;  Locale::Maketext::Lexicon v0.65;
Locale::Maketext::Lexicon::Gettext v0.16;  Log::Dispatch v2.20;
Log::Dispatch::Base v1.09;  Log::Dispatch::Output v1.26;
Log::Dispatch::Screen v1.17;  Log::Dispatch::Syslog v1.18;  Mail::Address
v2.02;  Mail::Field v2.02;  Mail::Field::AddrList v2.02;  Mail::Field::Date
v2.02;  Mail::Field::Generic v2.02;  Mail::Header v2.02;  Mail::Internet
v2.02;  Mail::Util v2.02;  MIME::Base64 v3.07;  MIME::Body v5.425;
MIME::Decoder v5.425;  MIME::Decoder::NBit v5.425;  MIME::Entity v5.425;
MIME::Field::ContDisp v5.425;  MIME::Field::ConTraEnc v5.425;
MIME::Field::ContType v5.425;  MIME::Field::ParamVal v5.425;  MIME::Head
v5.425;  MIME::Parser v5.425;  MIME::QuotedPrint v3.07;  MIME::Tools v5.425;
MIME::Words v5.425;  mod_perl v2.000003;  mod_perl2 v2.000003;
ModPerl::Const v2.000003;  Module::Refresh v0.13;  Module::Versions::Report
v1.03;  overload v1.01;  Params::Validate v0.89;  PerlIO v1.03;
PerlIO::scalar v0.02;  POSIX v1.08;  re v0.04;  Regexp::Common v2.120;
Regexp::Common::delimited v2.104;  RT v3.6.5;  RT::Interface::Email v2;
Scalar::Util v1.19;  SelectSaver v1.00;  Socket v1.77;  Storable v2.13;
strict v1.03;  Symbol v1.05;  Sys::Hostname v1.11;  Sys::Syslog v0.08;
Text::Autoformat v1.13;  Text::Quoted v2.03;  Text::Reform v1.11;
Text::Tabs v98.112801;  Text::Template v1.44;  Text::Wrapper v1.01;
Time::HiRes v1.9711;  Time::JulianDay v2003.1125;  Time::Local v1.1;
Time::ParseDate v2006.0814;  Time::Timezone v2006.0814;  Time::Zone v2.22;
UNIVERSAL v1.01;  UNIVERSAL::require v0.11;  URI v1.35;  URI::Escape v3.28;
URI::URL v5.03;  URI::WithBase v2.19;  utf8 v1.04;  vars v1.01;  warnings
v1.03;  warnings::register v1.00;  XSLoader v0.02;


Переменные RT
RT::AmbiguousDayInPast 1  
RT::BasePath /usr/local/newrt  
RT::BinPath /usr/local/newrt/bin  
RT::CORE_CONFIG_FILE /usr/local/newrt/etc/RT_Config.pm  
RT::CommentAddress ${HIDDEN}  
RT::CorrespondAddress ${HIDDEN}  
RT::DatabaseHost localhost  
RT::DatabaseName ${HIDDEN}  
RT::DatabasePassword Password not printed  
RT::DatabaseRTHost localhost  
RT::DatabaseType Oracle  
RT::DatabaseUser newrtadmin  
RT::DateDayBeforeMonth 1  
RT::DefaultSearchResultFormat '<B><A
HREF="/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#', '<B><A
HREF="/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
Status, QueueName, OwnerName, Priority, '__NEWLINE__', '',
'<small>__Requestors__</small>', '<small>__CreatedRelative__</small>',
'<small>__ToldRelative__</small>', '<small>__LastUpdatedRelative__</small>',
'<small>__TimeLeft__</small>'  
RT::DefaultSummaryRows 10  
RT::DevelMode 1  
RT::EmailOutputEncoding utf-8  
RT::EtcPath /usr/local/newrt/etc  
RT::FriendlyFromLineFormat "%s via RT" <%s>  
RT::FriendlyToLineFormat "%s of ${HIDDEN} Ticket #%s":;  
RT::LocalEtcPath /usr/local/newrt/local/etc  
RT::LocalLexiconPath /usr/local/newrt/local/po  
RT::LocalPath /usr/local/newrt/local  
RT::LogDir /usr/local/newrt/var/log  
RT::LogToFileNamed rt.log  
RT::LogToScreen error  
RT::LogToSyslog debug  
RT::LogoURL http://${HIDDEN}/i/home/logo-big.gif  
RT::LoopsToRTOwner 1  
RT::MailCommand sendmailpipe  
RT::MasonComponentRoot /usr/local/newrt/share/html  
RT::MasonDataDir /usr/local/newrt/var/mason_data  
RT::MasonLocalComponentRoot /usr/local/newrt/local/html  
RT::MasonSessionDir /usr/local/newrt/var/session_data  
RT::MaxAttachmentSize 10000000  
RT::MaxInlineBody 13456  
RT::MessageBoxWidth 72  
RT::MessageBoxWrap HARD  
RT::MinimumPasswordLength 5  
RT::OldestTransactionsFirst 1  
RT::Organization ${HIDDEN}  
RT::OwnerEmail rt-errors  
RT::RTAddressRegexp ^rt\@example.com$  
RT::RecordOutgoingEmail 1  
RT::RedistributeAutoGeneratedMessages privileged  
RT::SITE_CONFIG_FILE /usr/local/newrt/etc/RT_SiteConfig.pm  
RT::Sendmail /usr/sbin/sendmail  
RT::SendmailArguments -oi -t  
RT::SendmailBounceArguments -f "<>"  
RT::SendmailPath /usr/sbin/sendmail  
RT::ShowTransactionImages 1  
RT::StrictLinkACL 1  
RT::Timezone Europe/Moscow  
RT::UseFriendlyFromLine 1  
RT::VERSION 3.6.5  
RT::VarPath /usr/local/newrt/var  
RT::WebBaseURL http://${HIDDEN}
RT::WebDefaultStylesheet 3.4-compat  
RT::WebFlushDbCacheEveryRequest 1  
RT::WebImagesURL http://${HIDDEN}/NoAuth/images  
RT::WebPort 80  
RT::WebURL http://${HIDDEN}/  
RT::rtname ${HIDDEN}  

Конфигурация Perl
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=linux, osvers=2.6.9-22.18.bz155725.elsmp,
archname=x86_64-linux-thread-multi
    uname='linux hs20-bc1-3.build.redhat.com 2.6.9-22.18.bz155725.elsmp #1
smp thu nov 17 15:34:08 est 2005 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des -Doptimize=-O2 -g -pipe -m64 -Dversion=5.8.5
-Dmyhostname=localhost -Dperladmin=root at localhost -Dcc=gcc -Dcf_by=Red Hat,
Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dprivlib=/usr/lib/perl5/5.8.5
-Dsitelib=/usr/lib/perl5/site_perl/5.8.5
-Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.5
-Darchlib=/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
-Dsitearch=/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi
-Darchname=x86_64-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib
-Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun
-Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr
-Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=define uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -g -pipe -m64',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing
-pipe -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-2)',
gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/usr/local/lib64 /lib64 /usr/lib64
    libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared'



---
WBR,      Alexey G Misyurenko ( MAG-RIPE | MMAGG-RIPN )
Phone: +7 495 3632252            Cell:  +7 495 5082794





More information about the rt-users mailing list