ericzile / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

SaveToXml should not automatically encode html entities. #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a new post and save it using the following code snippet and 
the .NET client library.
-----------------------------
AtomEntry entry = new AtomEntry(); 
entry.Content.Content = "<b> Bold </b>"; 
entry.Content.Type = "html"; 
entry.Title.Text = "testing"; 

Service service = new Service(); 
NetworkCredential nc = new NetworkCredential(m_userName, m_password); 
service.Credentials = nc; 

AtomEntry postedEntry = service.Insert(new Uri(m_Url), entry); 
System.IO.MemoryStream stream = new System.IO.MemoryStream(); 
postedEntry.SaveToXml(stream); 
string sData = System.Text.Encoding.UTF8.GetString(stream.ToArray()); 
stream.Close(); 

----------------------------- 

What is the expected output? What do you see instead?

When I look at postedEntry - content is "&lt;b&gt;bold&lt;/b&gt;" and 
type is "html". When I call postedEntry.SaveToXml, the resulting xml 
string I get contains - 
"<content 
type=\"html\">&amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;</content>". The 
SaveToXml encoded &lt; to &amp;lt; which I think is incorrect. 

What version of the product are you using? On what operating system?
1.0.8 on Windows XP and Windows Server 2003.

Please provide any additional information below.

Original issue reported on code.google.com by mohanrao...@gmail.com on 4 Dec 2006 at 8:13

GoogleCodeExporter commented 9 years ago
Fixed with version 1.0.9.4 - available via subversion now. Please report back 
if the
issue is not resolved. 

Original comment by fman...@gmail.com on 25 Jan 2007 at 4:40