files_texteditor icon indicating copy to clipboard operation
files_texteditor copied to clipboard

txt(gbk_ansi) file preview have garbled

Open fcying opened this issue 8 years ago • 2 comments

Steps to reproduce

  1. upload test txt file
  2. preview txt file

Expected behaviour

display right.

Actual behaviour

test file title is right, content have garbled. txt create by windows default encoding is cp936(gbk)_ansi. if I change file encoding to utf-8, it display right.

cp936(gbk)_ansi file: 1

utf-8 file: 2

test_file: test_file.zip

Server configuration

docker nextcloud:latest ubuntu 16.04 sqlite

open the file by gvim in windows10 or vim in ubuntu 16.04, the file encoding is "cp936(gbk)"

vimrc setting:

set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

ansi

use file --mime-type --mime-encoding, result is text/plain; charset=iso-8859-1

fcying avatar Sep 26 '17 01:09 fcying

How to solve this problem?Can you explain it in detail? thank you

zjpwang avatar Oct 18 '18 12:10 zjpwang

How to solve this problem?Can you explain it in detail? thank you

Unresolved, just ignore it, not use gpk encoding files.

fcying avatar Oct 30 '18 08:10 fcying