Hello,

Since there are f*cking windows mail programs around which does not
handle utf8 email I had to look into how can I have utf8 frontend and
iso-8859-2 email encoding.

It Is Hell. It seems that OTRS was coded on the assumption that either
the world is utf8 or it isn't, coexistence denied.

Halfway I thought EncodeObject is a helpful thing, but it turned out that
I am unable to grasp the point what it is good for.

First, what I've thought. I believed it is the charset property of an object,
so if I have, say, message in 8859-15 then I can set its encodingObject to
know that it's 8859-15, so if I need it in, say, 8859-2, then I simply
tell the poor fella to Convert( $to_my_charset ) and it happens.


Nope.

EncodeObject is somehow tracking utf8'ness, but seems to be impossible
to use it to support any encoding. For example Sendmail.pm uses:

  $Self->{EncodeObject}->SetIO(\*MAIL);

Which should set handle to utf8 if the object is in utf8, and leave it
alone otherwise. But it does something magical: if $DefaultCharset is
utf8 then it sets handle to utf8. No matter what I set anywhere.


I believe this is wrong: EncodeObject should have an internal knowledge of its encoding (that's why it's an object, isn't it?) and act on that.

So if my web frontend is in utf8 I'd set

$article->{EncodeObject}->my_encoding('utf8'),
and if I want to send an email in 8859-2, then I could say

$new_article = $Self->{EncodeObject}->Convert('8859-2')

or like and I could go on and Send() it using Charset 8859-2.

Due to time constraints I am not able to completely analyse otrs object structure
so probably encoding could be attached some different way (this means that
my examples might have been stupid ones), but at the
end of the chain (like having the mail in Sendmail.pm or probably around the
web frontend) the result ought to know what its own encoding is and if the
output module wants a new encoding then it should be able to convert it
easily.


And Encode should use Encode::FB_HTMLCREF as "CHECK" value in encodings/decodings.

I didn't dare to start recoding EncodeObject since I don't yet grasp what it is
EXACTLY designed for.


--
Now using M2, Opera's e-mail client: http://www.opera.com/m2/

_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to