[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: PATCH: Outlook compatible attachment naming
From:       Ingo =?windows-1252?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2004-04-25 13:24:11
Message-ID: 200404251524.12267 () erwin ! ingo-kloecker ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Sunday 25 April 2004 12:46, Don Sanders wrote:
> Attached is a patch to provide better Outlook compatibility. The
> problem is that Microsoft appears to have fallen on hard times as
> they don't seem to be able to attract an engineer that is able to
> implement RFC2231 attachment naming. Instead mails that use RFC2231
> for attachment naming are shown in Outlook with cryptic names
> (ATT000...).
>
> Instead of breaking RFC compliance this patch renames attachments as
> suggested by Ingo. The renaming consists of substituting low-ascii
> characters for extended-ascii characters, so this patch only
> automatically solves the compatibility problem for latin based
> languages. In the case of an attachment name that can't be
> automatically handled the user is prompted "The message you have
> composed includes attachment with names that are Outlook
> incompatible. Do you want to rename these attachments now?" (as
> suggest by Ingo).

In the tooltip, shouldn't "attachment names containing non English 
characters" be "attachment names containing non Latin characters"?

Coding:
- Please put a space after each '(' and before each ')' (except in case 
of "()", of course).
- Use "const" for temporary variables whereever possible. Example:
  +    const QString name = msgPart->name();
  instead of
  +    QString name = msgPart->name();

In KMComposeWin::autoMakeAttachmentNamesAsciiOnly():
ß (223) should become "ss" since it's the German sz ligature.
ð (240) should become 'd' (not 'o').
Shouldn't
+      if (unicode < 32 || unicode > 255)
+       success = false;
be
+      if ( unicode < 32 || ( unicode >= 128 && unicode < 192 ) ||
+           unicode > 255 )
+       success = false;
After all attachments with characters between 128 and 191 won't be 
converted and thus will remain Outlook incompatible.

In KMComposeWin::renameAttachmentsWithNonAsciiNames():
+       if (name[i].unicode() < 32 || name[i].unicode() >= 192)
+         rename = true;
should be
+       if ( name[i].unicode() < 32 || name[i].unicode() >= 128 )
+         rename = true;

> I put the new "Outlook compatible attachment naming" option in the
> Attachments section of the composer dialog. Ingo suggested a tab on
> IRC but I lost the log.

This location is okay.

> I'm ok with moving the option elsewhere. 
> Sorry to add a new option, I dislike making the UI more complicated.
>
> There's some code for changing the name of a KMMsgPart. I can factor
> this into the KMMsgPart class if people think it's a good idea.

Yes, I think it would be good to put this into KMMsgPart.

Regards,
Ingo

[Attachment #5 (application/pgp-signature)]

_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic