Le 14 juin 08 à 16:43, Dex Morgan a écrit :

Hello,
I need to encode a quoted-printable text and convert it to given encoding according to the headers of a message.
I've used some code but the result is wrong.
For example =C3=A8 should be 'è' but the result is two symbols (the sqrt symbol and another).
I've made these steps:

1) Read the data and put it into an NSString with ISOLatin1StringEncoding
2) Replaced all =HEX chars sequences
3) Converted to an NSData using ISOLatin1StringEncoding
4) Read it from NSString using the defined encoding

This is the code:
NSString *plain = [[[NSString alloc] initWithData: self encoding:NSISOLatin1StringEncoding] stringFromQuotedPrintableFormat]; NSData *data = [plain dataUsingEncoding: enc allowLossyConversion: NO];
encoded = [[NSString alloc] initWithData: data encoding:enc];

Should it be

NSData *data = [plain dataUsingEncoding:NSISOLatin1StringEncoding allowLossyConversion: NO];


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to