Changeset 281
- Timestamp:
- 08/28/08 08:22:07 PM (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/message/MessagePartFactory.java
r71 r281 33 33 34 34 import java.io.IOException; 35 import java.io.UnsupportedEncodingException; 35 36 import net.rim.device.api.system.EncodedImage; 36 37 import org.logicprobe.LogicMail.util.StringParser; … … 99 100 } 100 101 else if(encoding.equalsIgnoreCase("base64")) { 102 byte[] textBytes; 101 103 try { 102 byte[] textBytes = UtilProxy.getInstance().Base64Decode(data); 103 data = new String(textBytes, StringParser.parseValidCharsetString(charset)); 104 textBytes = UtilProxy.getInstance().Base64Decode(data); 104 105 } 105 106 catch (IOException exp) { 106 107 return createUnsupportedPart("text", mimeSubtype, data); 108 } 109 110 try { 111 data = new String(textBytes, charset.toUpperCase()); 112 } 113 catch (UnsupportedEncodingException exp) { 114 // If encoding type is bad, attempt with the default encoding 115 // so the user will at least see something. 116 data = new String(textBytes); 107 117 } 108 118 }
