Forum How do I...?

Font/glyph/unicode

twelfth
̂I'm using Prince 8.0 on Mac OS X Lion, trying to convert from HTML to nicely-formatted PDF. But I'm having problems:

1. All the smart apostrophes, smart quotes, ellipses, and accented characters get rendered as funny characters like — / ̃© / ̂€TM.

2. I'm getting error messages that say things like "no glyphs for character U+009D, fallback to '?'"

Here's the output when I run prince:

%Desktop jay$ prince test.html

prince: test.html:848: error: Invalid char in CDATA 0xC
prince: warning: no glyphs for character U+009D, fallback to '?'

It doesn't appear to make a different which font I use—I get these errors with any font.

Any thoughts? Thanks for any help.
mikeday
If this is a HTML document, can you add this early in the <head> element:
<meta http-equiv="content-type" content="text/html; charset=utf-8">
twelfth
Amazing, it worked! Who knew it could be so easy?

My HTML files already contained this line:

<meta charset="utf-8">

But I guess that's not sufficient?

Anyway, I can't believe I spent four days trying to figure this out. Thank you thank you thank you!
mikeday
Actually that is sufficient for HTML5, but our HTML parser is not fully compliant with HTML5 yet; it's something we are working on at the moment. The longer http-equiv form of the meta tag is the older usage found in HTML4. Browsers should support both.
twelfth
I see. I'm using Brett Terpstra's Marked to convert from Markdown to HTML (before I using Prince to convert from HTML to PDF) and I guess Marked assumes HTML5.