R# 3.0.1 Encoding and document.

I use next code to read text from document:


I get inalid text for UTF-8 documents. I see valid text when i opening document
by IDE.

And I have another problem with modification UTF-8 documents.
The file Encoding is changed to system default and text is corrupted after
saving modification.

Alexander Nesterenko ( aka V.Petrovski on www.rsdn.ru)
mailto:framework3705@mail.ru

MSN: hectepehko@msn.com
ICQ: 121416708
Skype: Alex.Nesterenko


2 comments
Comment actions Permalink

Hello Alexander,

is the document you're trying to read currently opened in VS? If it is, then
ReSharper gets its text from VS. Otherwise, ReSharper uses
StreamReader with encoding detection to read document's text.


Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


I use next code to read text from document:

 public string GetText()
> {
> DocumentManager documentManager =
> DocumentManager.GetInstance(ProjectFile.GetSolution());
> IDocument document = documentManager.GetDocument(ProjectFile);
> return document.GetText();
> }
> ]]>

I get inalid text for UTF-8 documents. I see valid text when i opening
document by IDE.

And I have another problem with modification UTF-8 documents.
The file Encoding is changed to system default and text is corrupted
after
saving modification.
Alexander Nesterenko ( aka V.Petrovski on www.rsdn.ru)
mailto:framework3705@mail.ru
MSN: hectepehko@msn.com
ICQ: 121416708
Skype: Alex.Nesterenko



0
Comment actions Permalink

Hello Dmitry,

When document is opened in VS text is valid. Otherwise text is invalid.

Alexander Nesterenko ( aka V.Petrovski on www.rsdn.ru)
mailto:framework3705@mail.ru

MSN: hectepehko@msn.com
ICQ: 121416708
Skype: Alex.Nesterenko


0

Please sign in to leave a comment.