From 74fab1c53fd3850bf0fd075c93622f14ad8dbe30 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Wed, 06 Jan 2021 23:03:51 +0000
Subject: [PATCH] null pruefung hinzugefuegt

---
 src/java/de/uhilger/filecms/api/FileMgr.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/java/de/uhilger/filecms/api/FileMgr.java b/src/java/de/uhilger/filecms/api/FileMgr.java
index f2bf1cc..02a0029 100644
--- a/src/java/de/uhilger/filecms/api/FileMgr.java
+++ b/src/java/de/uhilger/filecms/api/FileMgr.java
@@ -37,7 +37,9 @@
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.Reader;
+import java.nio.charset.Charset;
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -194,8 +196,8 @@
         try {
           File targetFile = new File(getTargetDir(relPath), fileName);
 
-          //reader = new InputStreamReader(new FileInputStream(targetFile), "UTF8");
-          reader = new FileReader(targetFile);
+          reader = new InputStreamReader(new FileInputStream(targetFile), "UTF8");
+          //reader = new FileReader(targetFile);
           StringBuffer buf = new StringBuffer();
           char[] readBuffer = new char[1024];
           int charsRead = reader.read(readBuffer);
@@ -437,7 +439,7 @@
     FileRef savedFile = null;
     try {
       targetFile.createNewFile();
-      FileWriter w = new FileWriter(targetFile);
+      FileWriter w = new FileWriter(targetFile, Charset.forName("UTF-8"));
       //w.write(StringEscapeUtils.unescapeHtml(contents));
       w.write(contents);
       w.flush();

--
Gitblit v1.9.3