From coverity: more encoding fixes

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2274 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2014-03-18 23:47:40 +00:00
parent 9027f73a3c
commit d4efba3599
2 changed files with 7 additions and 7 deletions

View File

@ -225,7 +225,7 @@ public final class DavGateway {
HttpClient httpClient = DavGatewayHttpClientFacade.getInstance(HTTP_DAVMAIL_SOURCEFORGE_NET_VERSION_TXT);
int status = httpClient.executeMethod(getMethod);
if (status == HttpStatus.SC_OK) {
versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream()));
versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream(), "UTF-8"));
version = versionReader.readLine();
LOGGER.debug("DavMail released version: " + version);
}

View File

@ -2608,16 +2608,16 @@ public abstract class ExchangeSession {
.append((after ^ fromServer) ? "-server" : "-client")
.append(".ics");
if ((icsBody != null) && (icsBody.length() > 0)) {
FileWriter fileWriter = null;
OutputStreamWriter writer = null;
try {
fileWriter = new FileWriter(filePath.toString());
fileWriter.write(icsBody);
writer = new OutputStreamWriter(new FileOutputStream(filePath.toString()), "UTF-8");
writer.write(icsBody);
} catch (IOException e) {
LOGGER.error(e);
} finally {
if (fileWriter != null) {
if (writer != null) {
try {
fileWriter.close();
writer.close();
} catch (IOException e) {
LOGGER.error(e);
}
@ -3301,7 +3301,7 @@ public abstract class ExchangeSession {
GetMethod optionsMethod = new GetMethod("/owa/?ae=Options&t=About");
try {
DavGatewayHttpClientFacade.executeGetMethod(httpClient, optionsMethod, false);
optionsPageReader = new BufferedReader(new InputStreamReader(optionsMethod.getResponseBodyAsStream()));
optionsPageReader = new BufferedReader(new InputStreamReader(optionsMethod.getResponseBodyAsStream(), "UTF-8"));
String line;
// find email and alias