Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to auto detect , auto encoding ? #4846

Closed
xianghongai opened this issue Apr 1, 2016 · 41 comments
Closed

how to auto detect , auto encoding ? #4846

xianghongai opened this issue Apr 1, 2016 · 41 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@xianghongai
Copy link

hi ,

  • VSCode Version: 0.1011
  • OS Version:windows 7 x64

3

not working

{
    "files.encoding": "shiftjis",
    "files.encoding": "eucjp",
    "files.encoding": "big5hkscs",
    "files.encoding": "Big5",
    "files.encoding": "GB18030",
    "files.encoding": "GB2312",
    "files.encoding": "utf8",
    "files.encoding": "GBK"
}
@bpasero
Copy link
Member

bpasero commented Apr 3, 2016

@xianghongai so in what encoding is this file?

@bpasero bpasero added the info-needed Issue requires more information from poster label Apr 3, 2016
@xianghongai
Copy link
Author

hi,@bpasero ,
1
ANSI , Chinese Simplified(GBK) .

@bpasero
Copy link
Member

bpasero commented Apr 5, 2016

@xianghongai can you attach it here?

@iHuahua
Copy link

iHuahua commented Apr 5, 2016

兄弟,别指望了,我很久之前就提过,他们的回答是目前已经支持带DOM头的文件编码检测,不带DOM的不检测,我弄了个插件检测编码的,现在编码是检测成功了,但是切换编码卡住了,他喵的切换的API不开放,未来很长一段时间这个功能都不会有,不介意的话可以等等我的插件上线,由于接口限制,插件只能到 Change File Encoding那一步,顺带把检测的编码告诉你,手动切换一下

@bpasero
Copy link
Member

bpasero commented Apr 5, 2016

@iHuahua maybe as full file?

@xianghongai
Copy link
Author

@bpasero batch file :)
文件命名操作.zip

@xianghongai
Copy link
Author

@iHuahua 谢谢了,目前我是几个编辑器混着用的,可以解决一些问题,千万不要用sublime text编辑这种GBK编码格式的文件!我写批处理,几百行代码后,ST突然一个auto encoding 把我代码中文部分全乱码了!而且是撤销不了的乱码。

@bpasero
Copy link
Member

bpasero commented Apr 11, 2016

I do not see myself able to handle this issue, @egamma please advise.

@bpasero bpasero assigned egamma and unassigned bpasero Apr 11, 2016
@egamma
Copy link
Member

egamma commented Apr 13, 2016

@iHuahua @xianghongai the development team does not speak Chinese. Can you please find someone that can translate your comment to English?

@xianghongai
Copy link
Author

thx, @bpasero , @egamma ,
iHuahua he said the vs code support dom document encoding detection, he said he is developing a plug-in to solve the problem is not dom document coding, such as .txt .bat .reg files. because of the vs code interface restrictions, at present can only be achieved "Change File Encoding" by manual switching, can't auto encoding.
some problems because windows code pages (ANSI) by locale select the encoding, such as chinese simplified gbk, korean euc-kr, japanese cp932 and so on.
maybe these questions no solution.

@egamma egamma assigned bpasero and unassigned egamma Apr 14, 2016
@egamma
Copy link
Member

egamma commented Apr 14, 2016

fyi @bpasero

@fanfeilong
Copy link

fanfeilong commented Jun 7, 2016

hi, when open a Lua file which's encoding is GBK and without BOM header, the VS Code can not aoto dectect the encoding. I need to switch utf8 to GBK by hand every time i open a new such file, It's annoying. I've install the gbktoutf8 extension to solve it (ext install gbktoutf8). But I hope the VS Code have some configuration to do it better. The VIM editor can config the dectect encodings order, which is a convention solution to this problem. @egamma

@dongritengfei
Copy link

dongritengfei commented Jun 22, 2016

I have many projects, some of them are GBK encoded, other are UTF-8 encoded, so what can I do for setting different encoding for each project. appreciate for any help @egamma

@draculaw
Copy link

any updates for this issues?

@techteak
Copy link

please fix it

@Com-Mean
Copy link

any update of this issue?

@mauriciord
Copy link

Same here, always open a file at "UTF-8", but i need some files at "Western Windows 1252"

@skest3qc
Copy link

skest3qc commented Sep 6, 2016

I am also having this kind of problem. Orignal file is ANSI with german umlauts and code converts it to UTF-8, then I am loosing the umauts.

@os9sur
Copy link

os9sur commented Sep 6, 2016

Very very old problem.
We hope this issues can be resolved as soon as possible...

@mauriciord
Copy link

Yes, very old

Atenciosamente,
Maurício R. Duarte.

2016-09-06 10:14 GMT-03:00 White99 [email protected]:

Very very old problem.
We hope this issues can be resolved as soon as possible...


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4846 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABE4_aK7SW_Qo3YM7baB83EJRj9qzQqiks5qnWdCgaJpZM4H9aUH
.

@AaronWharton
Copy link

It's disgusting when I find all the notes have been garbled.It will take me hours to solve the issue.Why not release an extension to automatically switch the encoding format?

@zhangxaochen
Copy link

我的解决方式:
文件->首选项->用户设置->自动打开 settings.json。粘贴:

    // 读取和编写文件时将使用的默认字符集编码。
    "files.encoding": "GB2312"

GB大写。
done。

@DaniuLi
Copy link

DaniuLi commented Nov 14, 2016

any updates for this issues?

@9chu
Copy link

9chu commented Dec 2, 2016

It's a pity that vscode does not support auto encoding detect, but the Visual Studio does support that, and even the notepad2 could do that.

@jeffwbest
Copy link

any updates?

@fallenwood
Copy link
Member

any updates or new apis?

@visitantz
Copy link

It's indeed annoying, usually web related files are utf-8 encoding, windows platform files are local encoding, so "files.encoding" setting is not helping at all, you still need to manually set half files each time.

@liucailin
Copy link

any updates?

1 similar comment
@iKexinLL
Copy link

any updates?

@Forec
Copy link

Forec commented Feb 18, 2017

Any supports or updates?

@lionel3
Copy link

lionel3 commented Feb 18, 2017

Any updates?

@hackjackyer
Copy link

C:\Users\USERNAME\AppData\Roaming\Code\User\settings.json文件内容。即可
{ "files.encoding": "GB2312" }

@fallenwood
Copy link
Member

@hackjackyer 我们需要是VSCode自动检测文件编码并设置正确的编码,而不是只套用一个预设的编码


What we need is the ability that VSCode can detect the encoding of the file and set the correct encoding automatically rather than a default encoding to apply to all files.

@iKexinLL
Copy link

为什么不写个插件来对所有(或者大部分)的编码来进行判断呢?

Why not write a plugin for judge the encoding?
if encoding = 'utf-8'
elif ....

@lorensi
Copy link

lorensi commented Mar 3, 2017

Any updates?

@hakudev
Copy link

hakudev commented Mar 16, 2017

Update!

Pull request: #21416

@zjutjsj1004
Copy link

为什么我明明是UTF8,但是自动转换为GB2312,导致显示乱码

@a4027971
Copy link

a4027971 commented Jul 31, 2017

setting

"files.autoGuessEncoding": true,

@mauriciord
Copy link

setting

"files.autoGuessEncoding": true,

@a4027971 Is this option real ? Exists ?

@a4027971
Copy link

a4027971 commented Aug 1, 2017

Is this option real ? Exists ?
@mauriciord

VSCode verision : 1.14.1
OS : windows 7 x64

This option really exists

official documentation

@1255225613
Copy link

hot key:ctrl+Comma, then change " "files.autoGuessEncoding": false " to " "files.autoGuessEncoding": true ".

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests