Skip to content

Loading…

Explicitly specify encoding when generating string for NSTextView #184

Merged
merged 1 commit into from

1 participant

@grendello
Mono Project member

No description provided.

@grendello grendello merged commit 45edc87 into mono:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 4 additions and 0 deletions.
  1. +4 −0 Xwt.Mac/Xwt.Mac/RichTextViewBackend.cs
View
4 Xwt.Mac/Xwt.Mac/RichTextViewBackend.cs
@@ -215,8 +215,12 @@ public MacRichTextBuffer ()
Indent = true,
IndentChars = "\t"
});
+ xmlWriter.WriteDocType ("html", "-//W3C//DTD XHTML 1.0", "Strict//EN", null);
xmlWriter.WriteStartElement ("html");
xmlWriter.WriteAttributeString ("style", String.Format ("font-family: {0}; font-size: {1}", FontFamily, FontSize));
+ xmlWriter.WriteStartElement ("meta");
+ xmlWriter.WriteAttributeString ("http-equiv", "Content-Type");
+ xmlWriter.WriteAttributeString ("content", "text/html; charset=utf-8");
}
public NSAttributedString ToAttributedString ()
Something went wrong with that request. Please try again.