方法:

nextcloud/apps/files_texteditor/lib/Controller/FileHandlingController.php 第100行中,加入GB2312和GBK编码支持即可

$encoding= mb_detect_encoding($fileContents. 'a', 'UTF-8, GB2312, GBK, WINDOWS-1252, ISO-8859-15, ISO-8859-1, ASCII', true);