2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGExtensions_NGQuotedPrintableCoding_H__
23 #define __NGExtensions_NGQuotedPrintableCoding_H__
25 #import <Foundation/NSString.h>
26 #import <Foundation/NSData.h>
27 #include <NGExtensions/NGExtensionsDecls.h>
30 Quoted Printable encoder/decoder
32 As specified in RFC 822.
34 TODO: explain what it does. It doesn't seem to decode a full line like
35 "=?iso-8859-1?q?Yannick=20DAmboise?="
36 but only turns "=20D" style encodings to their charcode.
37 Note: apparently sope-mime contains a category on NSData which provides a
38 method to decode the full value:
39 -decodeQuotedPrintableValueOfMIMEHeaderField:
43 @interface NSString(QuotedPrintableCoding)
45 - (NSString *)stringByDecodingQuotedPrintable;
46 - (NSString *)stringByEncodingQuotedPrintable;
50 @interface NSData(QuotedPrintableCoding)
53 Decode a quoted printable encoded data. Returns nil if decoding failed.
55 - (NSData *)dataByDecodingQuotedPrintable;
58 Decode data in quoted printable encoding. Returns nil if encoding failed.
60 - (NSData *)dataByEncodingQuotedPrintable;
64 NGExtensions_EXPORT int
65 NGEncodeQuotedPrintable(const char *_src, unsigned _srcLen,
66 char *_dest, unsigned _destLen);
67 NGExtensions_EXPORT int
68 NGDecodeQuotedPrintable(const char *_src, unsigned _srcLen,
69 char *_dest, unsigned _destLen);
71 #endif /* __NGExtensions_NGQuotedPrintableCoding_H__ */