{
$mtime = OC_Filesystem::filemtime($path);
$filecontents = OC_Filesystem::file_get_contents($path);
+ $filecontents = iconv(mb_detect_encoding($filecontents), "UTF-8", $filecontents);
OCP\JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'false', 'mtime' => $mtime)));
}
} else {
// Save file
if(OC_Filesystem::is_writable($path))
{
+ $filecontents = iconv(mb_detect_encoding($filecontents), "UTF-8", $filecontents);
OC_Filesystem::file_put_contents($path, $filecontents);
// Clear statcache
clearstatcache();