Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Editor: Use different encoding on opening a document without user interaction

$
0
0

Hi,

I'm new to Visual Studio extensibility so I would appreciate some advice or hints on the problem I'm trying to solve.

The problem: I'm working on a very large C/C++ codebase and all the sources are encoded in a codepage that is not equal to the local windows codepage.
So every time I open up a source code file in VS I have to choose the codepage which is pretty anoying.
I'm aware that best solution would be to convert the sourcefiles to the local codepage (or even unicode) but this will be a bigger project because of 
some tools in the build process expecting the given codepage.

So having read this:
http://www.mztools.com/articles/2015/MZ2015002.aspx

and this: 
https://social.msdn.microsoft.com/Forums/vstudio/en-US/cc18b75d-430b-46f0-9176-0070bf0b0b5f/opening-editor-with-particular-code-page?forum=vsx

I'm still not sure on how to approach this. Possible solutions could be:

- Create a custom editor which is basically the "C++ Editor with encoding" and modify it that way that the needed codepage is automatically the default.
  Question would be: How much work is this. It does not seem like one could inherit from some existing editor.
- Use some "after document is opened"-Event (if there is something like this) to switch the codepage of the current document.
- Or maybe something completely different ?

regards
Tim


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>