Text editor: Always use UTF-8 to keep Ace happy.
This commit is contained in:
parent
0a6f7b33c3
commit
88cbbc86b8
|
@ -43,6 +43,7 @@ if(!empty($filename))
|
||||||
{
|
{
|
||||||
$mtime = OC_Filesystem::filemtime($path);
|
$mtime = OC_Filesystem::filemtime($path);
|
||||||
$filecontents = OC_Filesystem::file_get_contents($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)));
|
OCP\JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'false', 'mtime' => $mtime)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -48,6 +48,7 @@ if($path != '' && $mtime != '' && $filecontents)
|
||||||
// Save file
|
// Save file
|
||||||
if(OC_Filesystem::is_writable($path))
|
if(OC_Filesystem::is_writable($path))
|
||||||
{
|
{
|
||||||
|
$filecontents = iconv(mb_detect_encoding($filecontents), "UTF-8", $filecontents);
|
||||||
OC_Filesystem::file_put_contents($path, $filecontents);
|
OC_Filesystem::file_put_contents($path, $filecontents);
|
||||||
// Clear statcache
|
// Clear statcache
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
Loading…
Reference in New Issue