kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

HtmlViewer.DocumentSource returns broken string #305

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?
1. Use LoadFromString('<html></html>') to load a UnicodeString
2. Use DocumentSource to retrieve the string

What is the expected output?
"<html></html>"

What do you see instead?
"<html><??????"

Which version of the product are you using? Which compiler version are you
using? On which operating system?
svn revision 436. Delphi 2009. Windows 7.

The problem is in HtmlBuffer.pas TBuffConverter.AsString which copies only half 
the buffer content into the result string. The attached patch fixes this.

Example code:
  HtmlViewer1.LoadFromString('<html><body></body></html>');
  ShowMessage(HtmlViewer1.DocumentSource);

Original issue reported on code.google.com by Andreas....@gmail.com on 19 Sep 2013 at 5:43

Attachments:

GoogleCodeExporter commented 9 years ago
Andreas,

thanks for this fix.

r437 applies it.

OrphanCat

OT: I like your Delphi utilities :)

Original comment by OrphanCat on 2 Oct 2013 at 7:41

GoogleCodeExporter commented 9 years ago
Issue 348 has been merged into this issue.

Original comment by OrphanCat on 27 Apr 2014 at 10:39