Here's a quick proof of concept I built. I'm using dream v1.7.1.16671
Code:
using System;
using System.Collections.Generic;
using System.Text;
using MindTouch.Dream;
namespace dreammessage_utf
{
class Program
{
static void Main(string[] args)
{
string text = "“€2”";
string htmlText = "“€2”";
Plug p = Plug.New("http://mwc.mindtouch.com/");
DreamMessage plain = p.With("title", "Test").With("text", text ).Post();
DreamMessage escaped = p.With("title", "Test").With("text", htmlText).Post();
XDoc plainDoc = plain.ToDocument();
XDoc escapedDoc = escaped.ToDocument();
}
}
}
I sent the data to the public bridge, but if you look at the fiddler data below you'll see the issue is in the DreamMessage.
This is the conversation from "plain"
Code:
POST /?title=Test&text=%e2%80%9c%e2%82%ac2%e2%80%9d HTTP/1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Dream/1.7.1.16671
Host: mwc.mindtouch.com
Content-Length: 0
HTTP/1.1 200 OK
Date: Wed, 02 Dec 2009 20:32:17 GMT
Server: Apache/2.2.6 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ssl/2.2.6 OpenSSL/0.9.8g
X-Powered-By: PHP/5.2.6-1+lenny3
Vary: Accept-Encoding
Content-Length: 105
Connection: close
Content-Type: text/html
<html xmlns:mediawiki="#mediawiki"><head><title>Test</title></head><body><p>“€2”
</p></body></html>
And here's from "escaped"
Code:
POST /?title=Test&text=%26ldquo;%26euro;2%26rdquo; HTTP/1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Dream/1.7.1.16671
Host: mwc.mindtouch.com
Content-Length: 0
HTTP/1.1 200 OK
Date: Wed, 02 Dec 2009 20:32:20 GMT
Server: Apache/2.2.6 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ssl/2.2.6 OpenSSL/0.9.8g
X-Powered-By: PHP/5.2.6-1+lenny3
Vary: Accept-Encoding
Content-Length: 116
Connection: close
Content-Type: text/html
<html xmlns:mediawiki="#mediawiki"><head><title>Test</title></head><body><p>“€2”
</p></body></html>
Here is the debugger values from visual studio for the DreamMessages
Code:
plain {
<message>
<status>200</status>
<headers>
<Vary>Accept-Encoding</Vary>
<Connection>close</Connection>
<Content-Length>105</Content-Length>
<Content-Type>text/html</Content-Type>
<Date>Wed, 02 Dec 2009 20:32:17 GMT</Date>
<Server>Apache/2.2.6 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ssl/2.2.6 OpenSSL/0.9.8g</Server>
<X-Powered-By>PHP/5.2.6-1+lenny3</X-Powered-By>
</headers>
<body format="text">
&lt;html xmlns:mediawiki=&quot;#mediawiki&quot;&gt;&lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;??????2???
&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</body>
</message>
} MindTouch.Dream.DreamMessage
Code:
escaped {
<message>
<status>200</status>
<headers>
<Vary>Accept-Encoding</Vary>
<Connection>close</Connection>
<Content-Length>116</Content-Length>
<Content-Type>text/html</Content-Type>
<Date>Wed, 02 Dec 2009 20:32:20 GMT</Date>
<Server>Apache/2.2.6 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ssl/2.2.6 OpenSSL/0.9.8g</Server>
<X-Powered-By>PHP/5.2.6-1+lenny3</X-Powered-By>
</headers>
<body format="text">
&lt;html xmlns:mediawiki=&quot;#mediawiki&quot;&gt;&lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;&amp;ldquo;&amp;euro;2&amp;rdquo;
&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</body>
</message>
} MindTouch.Dream.DreamMessage
And the XDocs...
Code:
plainDoc {
<html xmlns:mediawiki="#mediawiki">
<head>
<title>Test</title>
</head>
<body>
<p>??????2???</p>
</body>
</html>
} MindTouch.Dream.XDoc
Code:
escapedDoc {
<html xmlns:mediawiki="#mediawiki">
<head>
<title>Test</title>
</head>
<body>
<p>“€2”</p>
</body>
</html>
} MindTouch.Dream.XDoc
Hope this helps. I'll definitely keep working on the converter guide, but it's a massive topic. You guys did a lot of work (and I see a lot of comments starting with SteveB
)