[MonoDevelop] UTF-16 support?

Michael Hutchinson m.j.hutchinson at gmail.com
Mon Mar 26 22:15:25 UTC 2012

On 26 March 2012 17:38, Megan Clodfelter <megan.clodfelter at gmail.com> wrote:
> Hi-
> I'm new to MonoDevelop, but not new to .NET development.  I have a C#
> project with UTF-16 characters, that appear not to be interpreted within
> MonoDevelop.
> One of the .cs files in my Project is of UTF-16 encoding, and that
> MonoDevelop does not display the characters in the code window, nor will it
> print out the contents of those character strings.  I dropped that file from
> that included project and re-added it, but was not given the option to add
> my file with encoding.
> The only place where I saw I could add a file with encoding was in the Open
> dialog; but that that didn't appear to work either.
> I can take my Windows C# file, cut and paste the characters into BBEdit and
> save on my Mac with encoding set as: UTF-16.  I then locate the file in the
> Finder and the characters are as I expect.  With the Mono Development
> environment open, I navigate to my file, select Encoding to "UTF-16" and
> select Open.
> I don't see my characters. I see an empty box where the character should be.
> What are the tips and tricks for getting UTF-16 characters to display and
> print as part of an included project in MonoDevelop?  I'm just not seeing
> it.
>  I am on version

Most likely this isn't an issue with detecting/loading UTF16, but
rather with *displaying* it. There was a longstanding bug in Pango,
the text rendering library used by MonoDevelop, that caused it not to
handle font fallbacks - i.e. if the main font didn't contain the glyph
for a given character, it wasn't able to fall back to another font for
that glyph. It's often possible to work around this by changing the
text editor font to one that has glyphs for all the characters you
care about.

The *Mono* 2.10.9 beta contains a new version of Pango (among other
things) that supports font fallbacks on Mac - I suggest you try that.

Michael Hutchinson

More information about the Monodevelop-list mailing list