Manage encoding files by extension of filenames #4891

Closed
FrancisFaure opened this Issue Apr 3, 2016 · 46 comments

Comments

@FrancisFaure

Hello "VS Code" team,

But in the same directory we can have files in utf8 and others in "Western" (Windows 1252) codepage

I tried to add "files.encoding": "windows1252" in my language pack (package.json) without success..

I googled without solutions

sorry for my bad english

With best regards
Francis

@bpasero bpasero changed the title from Manage encoding files by extension of filenames to Allow to configure encoding per file or folder Apr 4, 2016

@bpasero bpasero added this to the Backlog milestone Apr 4, 2016

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Apr 4, 2016

Member

Currently you can only configure encoding per workspace folder.

Member

bpasero commented Apr 4, 2016

Currently you can only configure encoding per workspace folder.

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Apr 4, 2016

Thank for the quick answer...
Have you plan to manage encoding files by extension of filenames ?
with by example add property "files.encoding" in file "package.json" of VS Code extension language.
Because same folder could have files encoded 1252 and others utf8
with best regards
Francis

Thank for the quick answer...
Have you plan to manage encoding files by extension of filenames ?
with by example add property "files.encoding" in file "package.json" of VS Code extension language.
Because same folder could have files encoded 1252 and others utf8
with best regards
Francis

@FrancisFaure FrancisFaure changed the title from Allow to configure encoding per file or folder to manage encoding files by extension of filenames Apr 4, 2016

@FrancisFaure FrancisFaure referenced this issue in mattslay/Visual-FoxPro-language-template-for-Visual-Studio-Code Apr 4, 2016

Closed

Code Page 1252 #1

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure May 6, 2016

please,
have you planned an VSCode update for allow add "files.encoding": "windows1252" in extension language package.json file?
or a way for open files by extension of filenames encoded 1252 and not utf8 (we need to open *.PRG files in 1252)
Thanks

please,
have you planned an VSCode update for allow add "files.encoding": "windows1252" in extension language package.json file?
or a way for open files by extension of filenames encoded 1252 and not utf8 (we need to open *.PRG files in 1252)
Thanks

@buzzzzer

This comment has been minimized.

Show comment
Hide comment
@buzzzzer

buzzzzer May 30, 2016

Any news for files.encoding in extention API or by fileext ?
On my project 3 different encodings in over 1000 files.
And reopen the file each time - just killing me...
Please schedule this feature..;(

Any news for files.encoding in extention API or by fileext ?
On my project 3 different encodings in over 1000 files.
And reopen the file each time - just killing me...
Please schedule this feature..;(

afable pushed a commit to afable/rDukieAthena that referenced this issue Aug 4, 2016

@cheery

This comment has been minimized.

Show comment
Hide comment
@cheery

cheery Aug 6, 2016

I am also affected by this issue.

Please fix it.

cheery commented Aug 6, 2016

I am also affected by this issue.

Please fix it.

@bpasero

This comment has been minimized.

Show comment
Hide comment
Member

bpasero commented Aug 15, 2016

@bpasero bpasero closed this Aug 15, 2016

@bpasero bpasero added the *duplicate label Aug 15, 2016

@FrankCai

This comment has been minimized.

Show comment
Hide comment
@FrankCai

FrankCai Mar 12, 2017

@bpasero That didn't fix the issue. We can now change editor.* settings but not the encoding setting.

@bpasero That didn't fix the issue. We can now change editor.* settings but not the encoding setting.

@bpasero bpasero reopened this Mar 13, 2017

@bpasero bpasero changed the title from manage encoding files by extension of filenames to Manage encoding files by extension of filenames Mar 13, 2017

@bpasero bpasero removed the *duplicate label Mar 13, 2017

@bpasero bpasero removed their assignment Mar 13, 2017

@bpasero bpasero removed this from the Backlog milestone Mar 13, 2017

@ianmaurinsoucy

This comment has been minimized.

Show comment
Hide comment
@ianmaurinsoucy

ianmaurinsoucy Mar 16, 2017

I am also affected by this issue. I have many files in the same folders with different encoding... I can't use VSCode because of this.

I am also affected by this issue. I have many files in the same folders with different encoding... I can't use VSCode because of this.

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Mar 16, 2017

I left my volunteer work on VS Code because of this encoding problem that was ignored. cordially

I left my volunteer work on VS Code because of this encoding problem that was ignored. cordially

@Somnium7

This comment has been minimized.

Show comment
Hide comment
@Somnium7

Somnium7 Apr 6, 2017

We also need possibility to set different encoding for different file extensions. Maybe it's possible to write an extension for this?

Somnium7 commented Apr 6, 2017

We also need possibility to set different encoding for different file extensions. Maybe it's possible to write an extension for this?

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Apr 6, 2017

to "Somnium7",
Hi
I work a lot (volunteer) on VS Code for manage encoding files by extension of filenames (in example like .HTML -> UTF8 and .PRG -> 1512 in the same directory)
But Microsoft ignore this request : it seem he want only manage UTF8 encoding or encoding per directories,
(Or bpassero haven't understood my request with my bad english)
The solution can be only an new line in package.json file or other way. but ignored.
if you find a solution for "set different encoding for different file extensions" : I'll happy
with best regards
Francis

to "Somnium7",
Hi
I work a lot (volunteer) on VS Code for manage encoding files by extension of filenames (in example like .HTML -> UTF8 and .PRG -> 1512 in the same directory)
But Microsoft ignore this request : it seem he want only manage UTF8 encoding or encoding per directories,
(Or bpassero haven't understood my request with my bad english)
The solution can be only an new line in package.json file or other way. but ignored.
if you find a solution for "set different encoding for different file extensions" : I'll happy
with best regards
Francis

@freMea

This comment has been minimized.

Show comment
Hide comment
@freMea

freMea May 3, 2017

I tried to add

"[bat]": {
    "files.encoding": "cp437",
    "files.autoGuessEncoding": false,
    "editor.fontFamily": "Consolas, 'Courier New', monospace"
}

to the settings.json

files.encoding and files.autoGuessEncoding triggers an issue displayed in the tooltip on mouseover: Unknown identifier. Use language identifiers.

It is impossible now to set those settings as per language rule, please fix it.

VS Code 1.11.2 on Win 10 x64
Edit: still an big issue in v 1.15.0 insider

freMea commented May 3, 2017

I tried to add

"[bat]": {
    "files.encoding": "cp437",
    "files.autoGuessEncoding": false,
    "editor.fontFamily": "Consolas, 'Courier New', monospace"
}

to the settings.json

files.encoding and files.autoGuessEncoding triggers an issue displayed in the tooltip on mouseover: Unknown identifier. Use language identifiers.

It is impossible now to set those settings as per language rule, please fix it.

VS Code 1.11.2 on Win 10 x64
Edit: still an big issue in v 1.15.0 insider

@z639

This comment has been minimized.

Show comment
Hide comment
@z639

z639 May 6, 2017

What I find funny is that my old>old editor of choice (Notepad++) is able to auto detect the file encoding and yet VS Code with all its bells and whistles that make it a far better editor can't even manage to do the same.

At the very least you would think that we would be able to tell the editor to use X encoding for Y file type.

z639 commented May 6, 2017

What I find funny is that my old>old editor of choice (Notepad++) is able to auto detect the file encoding and yet VS Code with all its bells and whistles that make it a far better editor can't even manage to do the same.

At the very least you would think that we would be able to tell the editor to use X encoding for Y file type.

@jhonrocha

This comment has been minimized.

Show comment
Hide comment
@jhonrocha

jhonrocha May 11, 2017

This problem is still not solved? It is the biggest miss of Code right now ... Please, take it seriously for a moment. I never lost an afternoon replacing bad chars due a miss while saving a file on Sublime ...

This problem is still not solved? It is the biggest miss of Code right now ... Please, take it seriously for a moment. I never lost an afternoon replacing bad chars due a miss while saving a file on Sublime ...

@freMea

This comment has been minimized.

Show comment
Hide comment
@freMea

freMea May 11, 2017

Guys, you have to vote for the first post (thumb up) so this issue may be taken seriously. With only 2 votes everybody won't care even if it's an annoying issue.

freMea commented May 11, 2017

Guys, you have to vote for the first post (thumb up) so this issue may be taken seriously. With only 2 votes everybody won't care even if it's an annoying issue.

@ElCondor1969

This comment has been minimized.

Show comment
Hide comment
@ElCondor1969

ElCondor1969 May 30, 2017

A question to developer guys.
Will this issue be taken into account shortly and put into a milestone?
It's really a big flaw to reopen a multitude of files for work with the right encoding.
It's a shameful issue.

A question to developer guys.
Will this issue be taken into account shortly and put into a milestone?
It's really a big flaw to reopen a multitude of files for work with the right encoding.
It's a shameful issue.

@hebu

This comment has been minimized.

Show comment
Hide comment
@hebu

hebu Jun 13, 2017

Yes, please fix the issues with "auto guess encoding". I tried to use this setting, but it tends to guess japanese encodings for utf-8 encoded markdown files or Windows-1252 encoded PowerShell skripts. And if you don't see it while saving, you'll lose all your special characters in the file (thanks to version control at this moment, but still you lose working time...)

hebu commented Jun 13, 2017

Yes, please fix the issues with "auto guess encoding". I tried to use this setting, but it tends to guess japanese encodings for utf-8 encoded markdown files or Windows-1252 encoded PowerShell skripts. And if you don't see it while saving, you'll lose all your special characters in the file (thanks to version control at this moment, but still you lose working time...)

@dudamoos

This comment has been minimized.

Show comment
Hide comment
@dudamoos

dudamoos Jun 14, 2017

This feature is actually really important for VHDL. The standard CHARACTER type in VHDL is defined by the ISO 8859-1 character set. Because CHARACTER is an enumeration and "each of the 191 graphic characters of this character set is denoted by the corresponding character literal" (VHDL LRM section 3.1.1.1), it is very difficult to use these values unless your editor uses the ISO 8859-1 character set for VHDL files. If you open up the std.STANDARD package (included in most EDA tools that support VHDL), you will see all of the values for CHARACTER replaced with unknown character symbols. Additionally, it will mangle files using these symbols when you save by converting all the non-ASCII characters to a UTF-8 bad character symbol, thus destroying data.

TL;DR: In order to use Visual Studio Code to edit VHDL files while still being able to use it to edit files in other languages encoded as UTF-8 (e.g. XML and HTML), this feature is extremely important.

This feature is actually really important for VHDL. The standard CHARACTER type in VHDL is defined by the ISO 8859-1 character set. Because CHARACTER is an enumeration and "each of the 191 graphic characters of this character set is denoted by the corresponding character literal" (VHDL LRM section 3.1.1.1), it is very difficult to use these values unless your editor uses the ISO 8859-1 character set for VHDL files. If you open up the std.STANDARD package (included in most EDA tools that support VHDL), you will see all of the values for CHARACTER replaced with unknown character symbols. Additionally, it will mangle files using these symbols when you save by converting all the non-ASCII characters to a UTF-8 bad character symbol, thus destroying data.

TL;DR: In order to use Visual Studio Code to edit VHDL files while still being able to use it to edit files in other languages encoded as UTF-8 (e.g. XML and HTML), this feature is extremely important.

@workflo

This comment has been minimized.

Show comment
Hide comment
@workflo

workflo Jul 13, 2017

Any news on this one? It's a real bummer :(

workflo commented Jul 13, 2017

Any news on this one? It's a real bummer :(

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Jul 13, 2017

No news from Microsoft on my side ...

No news from Microsoft on my side ...

@freMea

This comment has been minimized.

Show comment
Hide comment
@freMea

freMea Jul 13, 2017

If only an extension could handle encoding according to a rule in settings.json or/and a comment at top of the file specifying the wanted priority encoding for this specific file.

But even then, VSCode doesn't even support some basic encoding such as OEM alias cp 850 needed to display foreign chars and ASCII cosmetics in batch files. #23646 (vote for this issue too please).

And yes the auto guessing encoding feature sucks comparing to other good old basic text editors and you can loose some works (special/foreign chars being corrupted) if you saved your file trusting Code to process the right encoding from its opening.

😓

@FrancisFaure So, you said your team has offered a Pull Request to VSCode for this very issue and they didn't answer or valid? (I think your english is understandable but I could have bias since I'm french too 😉)

freMea commented Jul 13, 2017

If only an extension could handle encoding according to a rule in settings.json or/and a comment at top of the file specifying the wanted priority encoding for this specific file.

But even then, VSCode doesn't even support some basic encoding such as OEM alias cp 850 needed to display foreign chars and ASCII cosmetics in batch files. #23646 (vote for this issue too please).

And yes the auto guessing encoding feature sucks comparing to other good old basic text editors and you can loose some works (special/foreign chars being corrupted) if you saved your file trusting Code to process the right encoding from its opening.

😓

@FrancisFaure So, you said your team has offered a Pull Request to VSCode for this very issue and they didn't answer or valid? (I think your english is understandable but I could have bias since I'm french too 😉)

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Jul 13, 2017

Hi @freMea,

I just read your issue :
#23646
opened the march 30 of 2017

My issue :
#4891
opened the 3 April of 2016

I think we have the same probleme (or near) = a folder can have files with different extension filenames : .html / .css / .asp / .aspx /.prg / .bat ...
but, if I well understand: vscode can not manage encoding per extension of filenames, but only by folders

for my language extension I proposed to add in "package.json" the encoding code or have an other similar solution.

about your sentence "So, you said your team has offered a Pull Request to VSCode for this very issue and they didn't answer or valid?" :
My english is very poor and Google Trad: can not help me about your "Pull Request" : I don't understood.

with best regards
Francis

Hi @freMea,

I just read your issue :
#23646
opened the march 30 of 2017

My issue :
#4891
opened the 3 April of 2016

I think we have the same probleme (or near) = a folder can have files with different extension filenames : .html / .css / .asp / .aspx /.prg / .bat ...
but, if I well understand: vscode can not manage encoding per extension of filenames, but only by folders

for my language extension I proposed to add in "package.json" the encoding code or have an other similar solution.

about your sentence "So, you said your team has offered a Pull Request to VSCode for this very issue and they didn't answer or valid?" :
My english is very poor and Google Trad: can not help me about your "Pull Request" : I don't understood.

with best regards
Francis

@workflo

This comment has been minimized.

Show comment
Hide comment
@Raydir

This comment has been minimized.

Show comment
Hide comment
@Raydir

Raydir Aug 24, 2017

voted for this issue.

Raydir commented Aug 24, 2017

voted for this issue.

@roffelsaurus

This comment has been minimized.

Show comment
Hide comment
@roffelsaurus

roffelsaurus Sep 6, 2017

"files.autoGuessencoding": true worked for me auto detecting win1252 on opening. The changes in @workflo link seem to at least have given a workaround for this issue.

"files.autoGuessencoding": true worked for me auto detecting win1252 on opening. The changes in @workflo link seem to at least have given a workaround for this issue.

@BlackOnion

This comment has been minimized.

Show comment
Hide comment
@BlackOnion

BlackOnion Sep 6, 2017

Voted for this issue.
I like VSCode very much, but not be able to set the encoding per file extension is a absolute no go. Even every normal text editor need this feature. I used it in the last millennium.

BlackOnion commented Sep 6, 2017

Voted for this issue.
I like VSCode very much, but not be able to set the encoding per file extension is a absolute no go. Even every normal text editor need this feature. I used it in the last millennium.

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Sep 9, 2017

Member

Trying to understand the requirements here. So far I have seen various requests to associate a file encoding

  • by language (#19890)
  • by extension (this issue)
  • by path (#23570)

It seems to me that being able to define the encoding by path is most powerful because it would allow to define the encoding for particular files in specific folders. And it would also allow to define for all files in all folders of a specific extension.

The beauty however of allowing to define the encoding by language is that we already have support for defining settings per language. The syntax is:

"[markdown]":  {
  "editor.wordWrap": "on",
  "editor.quickSuggestions": false
}

And so I could envision a setting such as:

"[markdown]":  {
  "files.encoding": "some encoding"
}

There is another related setting where you can define which extension maps to which language (files.association).

The downside of this solution though is that you cannot set the encoding for a subset of files of a language. It would always apply to all files of that language.

Member

bpasero commented Sep 9, 2017

Trying to understand the requirements here. So far I have seen various requests to associate a file encoding

  • by language (#19890)
  • by extension (this issue)
  • by path (#23570)

It seems to me that being able to define the encoding by path is most powerful because it would allow to define the encoding for particular files in specific folders. And it would also allow to define for all files in all folders of a specific extension.

The beauty however of allowing to define the encoding by language is that we already have support for defining settings per language. The syntax is:

"[markdown]":  {
  "editor.wordWrap": "on",
  "editor.quickSuggestions": false
}

And so I could envision a setting such as:

"[markdown]":  {
  "files.encoding": "some encoding"
}

There is another related setting where you can define which extension maps to which language (files.association).

The downside of this solution though is that you cannot set the encoding for a subset of files of a language. It would always apply to all files of that language.

@Somnium7

This comment has been minimized.

Show comment
Hide comment
@Somnium7

Somnium7 Sep 9, 2017

@bpasero I think that defining by path should allow wildcards to be able to match files by extension only. However, it could be harder to implement than detecting by language, because it needs new configuration syntax. For my personal needs, detection by language suffices. Let's see, what other people think.

Somnium7 commented Sep 9, 2017

@bpasero I think that defining by path should allow wildcards to be able to match files by extension only. However, it could be harder to implement than detecting by language, because it needs new configuration syntax. For my personal needs, detection by language suffices. Let's see, what other people think.

@ElCondor1969

This comment has been minimized.

Show comment
Hide comment
@ElCondor1969

ElCondor1969 Sep 10, 2017

I agree with @Somnium7 . Detection by language is the simplest and, at present, the fastest thing to implement.

I agree with @Somnium7 . Detection by language is the simplest and, at present, the fastest thing to implement.

@workflo

This comment has been minimized.

Show comment
Hide comment
@workflo

workflo Sep 11, 2017

I would like to add a fourth alternative to @bpasero's proposal:
It would be great if I could annotate an arbitrary text file and explicitly tell VSC which encoding to use. This was one of (X)Emacs' features I really liked:
// -*- coding: latin1 -*-

Emacs also allows overriding other settings like indentation mode, tab width and the like this way.

workflo commented Sep 11, 2017

I would like to add a fourth alternative to @bpasero's proposal:
It would be great if I could annotate an arbitrary text file and explicitly tell VSC which encoding to use. This was one of (X)Emacs' features I really liked:
// -*- coding: latin1 -*-

Emacs also allows overriding other settings like indentation mode, tab width and the like this way.

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Sep 11, 2017

Member

I have pushed a change that allows to configure the encoding per language in settings (see #19890 (comment)). Will be available in tomorrows insider release. I think we should see how it goes with this support before we introduce more powerful settings.

Member

bpasero commented Sep 11, 2017

I have pushed a change that allows to configure the encoding per language in settings (see #19890 (comment)). Will be available in tomorrows insider release. I think we should see how it goes with this support before we introduce more powerful settings.

@BlackOnion

This comment has been minimized.

Show comment
Hide comment
@BlackOnion

BlackOnion Sep 15, 2017

Thank you, Benjamin.
I used the insider for a very small test and it worked for me.

Thank you, Benjamin.
I used the insider for a very small test and it worked for me.

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Sep 15, 2017

Member

@FrancisFaure ok to close?

Member

bpasero commented Sep 15, 2017

@FrancisFaure ok to close?

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Sep 15, 2017

Hi @bpasero,
I don't had/took time to test the solution of this issue (I work on vscode on my free time and my english is poor) I think I can work on that: this week-end.
(If in the same directory we can have some files with differents encoding : ie .PRG in cp1252, .XML in utf8, ... and if I can set encoding for .PRG (in any directories) that could be great)
with best regards
Francis

FrancisFaure commented Sep 15, 2017

Hi @bpasero,
I don't had/took time to test the solution of this issue (I work on vscode on my free time and my english is poor) I think I can work on that: this week-end.
(If in the same directory we can have some files with differents encoding : ie .PRG in cp1252, .XML in utf8, ... and if I can set encoding for .PRG (in any directories) that could be great)
with best regards
Francis

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Sep 15, 2017

Member

@FrancisFaure yes, the current solution allows to change the encoding for language types. This is possible globally or per workspace folder.

Member

bpasero commented Sep 15, 2017

@FrancisFaure yes, the current solution allows to change the encoding for language types. This is possible globally or per workspace folder.

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Sep 15, 2017

Hi @bpasero
when you write "language types" = that mean by extension of filenames (ie : .PRG, .BAT, .CMD, .XML...) ?
is it a setting in package.json of language extension ? other ? (if other have you a url link for read and test please)
Regards

Hi @bpasero
when you write "language types" = that mean by extension of filenames (ie : .PRG, .BAT, .CMD, .XML...) ?
is it a setting in package.json of language extension ? other ? (if other have you a url link for read and test please)
Regards

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Sep 15, 2017

Member

@FrancisFaure this is an indirection: multiple extensions can be associated with one language. I suggest you give it a try and report back how it works for you.

Member

bpasero commented Sep 15, 2017

@FrancisFaure this is an indirection: multiple extensions can be associated with one language. I suggest you give it a try and report back how it works for you.

@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Sep 15, 2017

Hi @bpasero
ok I will work on the subject this weekend,
Thank you
I'll let you informed after finding the links on VSCODE to define a "language type" to link the extension .PRG + tests
If you want, you can close the subject and if necessary reopen it if it does not work?
(Sorry for my bad English)
regards

Hi @bpasero
ok I will work on the subject this weekend,
Thank you
I'll let you informed after finding the links on VSCODE to define a "language type" to link the extension .PRG + tests
If you want, you can close the subject and if necessary reopen it if it does not work?
(Sorry for my bad English)
regards

@bpasero bpasero closed this Sep 15, 2017

@bpasero bpasero self-assigned this Sep 15, 2017

@bpasero bpasero added this to the September 2017 milestone Sep 15, 2017

@jhonrocha

This comment has been minimized.

Show comment
Hide comment
@jhonrocha

jhonrocha Sep 15, 2017

Hello @bpasero
I just tried the insiders version. They're working perfectly on both global and workspace settings!
Thank you, best regards

// ---- My settings.json ----
{
    "[asp]":{
      "files.encoding": "iso88591"
    },
    "[javascript]":{
      "files.encoding": "utf8"
    },
    "[html]":{
      "files.encoding": "utf8"
    }
}

jhonrocha commented Sep 15, 2017

Hello @bpasero
I just tried the insiders version. They're working perfectly on both global and workspace settings!
Thank you, best regards

// ---- My settings.json ----
{
    "[asp]":{
      "files.encoding": "iso88591"
    },
    "[javascript]":{
      "files.encoding": "utf8"
    },
    "[html]":{
      "files.encoding": "utf8"
    }
}
@FrancisFaure

This comment has been minimized.

Show comment
Hide comment
@FrancisFaure

FrancisFaure Sep 16, 2017

Hi @bpasero,
I tested with VS Code Insider :

a) I added in my settings (stored in C:\Users\USER\AppData\Roaming\Code - Insiders\User\settings.json):

    "[vfp]":{
        "files.encoding": "windows1252"
    }

that work well.

b) I removed my settings of §a
and added in my package.json language :

	"contributes": {
		"configurationDefaults": {
		  "[vfp]": {
			"files.encoding": "windows1252"
		  }
		}...

and that work ! great ! it's what I needed :)
with best regards
Francis

Hi @bpasero,
I tested with VS Code Insider :

a) I added in my settings (stored in C:\Users\USER\AppData\Roaming\Code - Insiders\User\settings.json):

    "[vfp]":{
        "files.encoding": "windows1252"
    }

that work well.

b) I removed my settings of §a
and added in my package.json language :

	"contributes": {
		"configurationDefaults": {
		  "[vfp]": {
			"files.encoding": "windows1252"
		  }
		}...

and that work ! great ! it's what I needed :)
with best regards
Francis

@bpasero bpasero added the on-testplan label Sep 21, 2017

@bpasero bpasero referenced this issue Sep 21, 2017

Closed

Test: configure encoding per file type #34769

2 of 2 tasks complete
@Raydir

This comment has been minimized.

Show comment
Hide comment
@Raydir

Raydir Oct 2, 2017

works like a bomb

Raydir commented Oct 2, 2017

works like a bomb

@Somnium7

This comment has been minimized.

Show comment
Hide comment
@Somnium7

Somnium7 Oct 9, 2017

@bpasero
Doesn't work search in multiple files without Ripgrep (haven't tested with it, don't need it).
I have files which need "maccenteuro" encoding, let assume it is Javascript.
With following configuration search works in all files except ".js".
"search.useRipgrep": false
With following configuration works in none files except ".js".
"search.useRipgrep": false,
"files.encoding": "maccenteuro"
With following configuration search should work for all files (seems logic), however, it works in all files except ".js" (like first case):
"search.useRipgrep": false,
"[javascript]": {
"files.encoding": "maccenteuro"
}
Note that when opening actual files encoding is working properly, only search in multiple files doesn't work. Also note that when testing, you should use symbols with diacritics, which have different representations in different encodings.

Tested in VSCode version 1.17.0 on Windows 10

Somnium7 commented Oct 9, 2017

@bpasero
Doesn't work search in multiple files without Ripgrep (haven't tested with it, don't need it).
I have files which need "maccenteuro" encoding, let assume it is Javascript.
With following configuration search works in all files except ".js".
"search.useRipgrep": false
With following configuration works in none files except ".js".
"search.useRipgrep": false,
"files.encoding": "maccenteuro"
With following configuration search should work for all files (seems logic), however, it works in all files except ".js" (like first case):
"search.useRipgrep": false,
"[javascript]": {
"files.encoding": "maccenteuro"
}
Note that when opening actual files encoding is working properly, only search in multiple files doesn't work. Also note that when testing, you should use symbols with diacritics, which have different representations in different encodings.

Tested in VSCode version 1.17.0 on Windows 10

@buzzzzer

This comment has been minimized.

Show comment
Hide comment
@buzzzzer

buzzzzer Oct 10, 2017

@bpasero
Search in multiple files doesn't work with setting by language
Win10 1.17.0 release

@bpasero
Search in multiple files doesn't work with setting by language
Win10 1.17.0 release

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Oct 10, 2017

Member

@roblourens is aware of that limitation afaik.

Member

bpasero commented Oct 10, 2017

@roblourens is aware of that limitation afaik.

@Somnium7

This comment has been minimized.

Show comment
Hide comment
@Somnium7

Somnium7 Oct 15, 2017

@roblourens Are you (or another person) going to fix this? Maybe a new issue should be created?

@roblourens Are you (or another person) going to fix this? Maybe a new issue should be created?

@roblourens

This comment has been minimized.

Show comment
Hide comment
@roblourens

roblourens Oct 16, 2017

Member

This is the library that would have to support those encodings: https://github.com/hsivonen/encoding_rs

It's probably unlikely, as it's not a standard encoding.

Member

roblourens commented Oct 16, 2017

This is the library that would have to support those encodings: https://github.com/hsivonen/encoding_rs

It's probably unlikely, as it's not a standard encoding.

@Microsoft Microsoft 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.