forked from I2P_Developers/i2p.i2p
SusiMail: Don't convert underscore to space after base64 decoding
This commit is contained in:
@@ -195,18 +195,26 @@ public class HeaderLine extends Encoding {
|
|||||||
String charset = new String(in, f1 + 1, f2 - f1 - 1, "ISO-8859-1");
|
String charset = new String(in, f1 + 1, f2 - f1 - 1, "ISO-8859-1");
|
||||||
String clc = charset.toLowerCase(Locale.US);
|
String clc = charset.toLowerCase(Locale.US);
|
||||||
if (clc.equals("utf-8") || clc.equals("utf8")) {
|
if (clc.equals("utf-8") || clc.equals("utf8")) {
|
||||||
for( int j = 0; j < tmp.length; j++ ) {
|
if (enc.equals("quoted-printable")) {
|
||||||
byte d = tmp.content[ tmp.offset + j ];
|
for( int j = 0; j < tmp.length; j++ ) {
|
||||||
out.write( d == '_' ? 32 : d );
|
byte d = tmp.content[ tmp.offset + j ];
|
||||||
|
out.write( d == '_' ? 32 : d );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.write(tmp.content, tmp.offset, tmp.length);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// decode string
|
// decode string
|
||||||
String decoded = new String(tmp.content, tmp.offset, tmp.length, charset);
|
String decoded = new String(tmp.content, tmp.offset, tmp.length, charset);
|
||||||
// encode string
|
// encode string
|
||||||
byte[] utf8 = DataHelper.getUTF8(decoded);
|
byte[] utf8 = DataHelper.getUTF8(decoded);
|
||||||
for( int j = 0; j < utf8.length; j++ ) {
|
if (enc.equals("quoted-printable")) {
|
||||||
byte d = utf8[j];
|
for( int j = 0; j < utf8.length; j++ ) {
|
||||||
out.write( d == '_' ? 32 : d );
|
byte d = utf8[j];
|
||||||
|
out.write( d == '_' ? 32 : d );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.write(utf8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int distance = f4 + 2 - offset;
|
int distance = f4 + 2 - offset;
|
||||||
|
Reference in New Issue
Block a user