Source file Encoding in Visual Studio (VS2005, but may apply to other versions)

Is it possible to easily view the current encoding of a file (utf-8, utf-8 without specification, ascii, western, etc.)?

I work mainly on web applications, so this is important to me.

I can not find it anywhere except the Save As dialog ... When you save the file in Visual Studio, you can select Save MyClass.cs as, and then click the down arrow and select Save with Encoding ... . Then you have the opportunity to see and change the currently selected encoding options and line endings. But it's 4-5 clicks, too much work for such simple information !?

There is a View.ChooseEncoding command, but no luck in starting it, all I get is the View.ChooseEncoding command is not available.

I tried to display it in the status bar with my own add-in, but with no luck, I can not find encoding information anywhere in the automation API. I used EnvDTE.Document to access current file information when opening / saving.

+3
source share
2 answers

Bokka,

? , Visual Studio ( , 2005) . -, , , Latin1, ISO-8859-1, Extended-ASCII, . / , " " .

, Visual Studio 2005 64- (, Vista64) Unicode (UTF8 ); , Visual Studio 2008 .

- ? web.config ? fileEncoding, .

   <system.web>
      <globalization 
         fileEncoding="iso-8859-1"
         requestEncoding="utf-8"
         responseEncoding="utf-8" />
   </system.web>

, , "", ( UTF-8 , ) ( ).

NCharDet, ( ), , ( , ). MLang "API" Microsoft .

, ...

+1

: Unicode, .

0

Source: https://habr.com/ru/post/1704431/


All Articles