Incorrect encoding at last line?

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Michel van den Berg
Avatar
Dear actipro,

I have a memory stream containing the following:
Public Class $itemname$[][][][]End Class[][]
where [] is a carriage return.

I got this content by doing:

Dim reader As New IO.StreamReader(stream)
Dim content As String = reader.ReadToEnd
Microsoft.VisualBasic.Asc(content.Chars(23)) ' result is ascii code 16 = carriage return
where stream is the memorystream.

However, when opening that stream using
 Me.syntaxEditor.Document.LoadFile(stream, System.Text.Encoding.Default)
I see this in the syntaxeditor:
Public Class $itemname$

End Class
[]
Notice the [] (carriage return) at the last line! It seems that the syntaxeditor does convert the first 4 carriage returns, but for the last two, it fails somehow.
The content does display ok using the immediate window of VS2005.

Comments (2)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Michel,

It's hard to say what is happening without debugging. Can you put together a tiny sample project that shows this happening? It may just be what the System.IO code gives us or it may be a problem in our code. Having the repro sample would tell us. Thanks!


Actipro Software Support

Posted 12 years ago by Michel van den Berg
Avatar
Dear Actipro,

It seems the problem is solved in my little sample I just build! So, no problem on your side: my bad! The memorystream is build from a zip archive using a zip library: I suspect there is something wrong there. Thanks for the great support anyhow!

Greetings,

Michel

[Modified at 09/27/2007 03:27 PM]

[Modified at 09/27/2007 03:27 PM]
The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.