Forum Bugs

Simple characters not showing up correctly

exeunt
I'm having an issue where PrinceXML will not export some simple characters, such as an apostrophe or double quotes properly. Instead it shows something like:

â??

I'm using the windows version, and I've tried adding css to allow for multiple fonts:

body {font-family:"Arial", "Verdana", serif;}
td {font-family:"Arial", "Verdana", serif;}

But I'm still seeing these relatively common characters misprinted.
mikeday
This sounds like a character encoding issue. If your document is XML or XHTML, please ensure that the declared encoding matches the actual encoding of the document. For example, if you declare that you are using ISO-8859-1 encoding in the XML declaration like this:
<?xml version="1.0" encoding="ISO-8859-1"?>

but then actually use UTF-8 encoding in the document, then you may experience garbled characters.

If your document is HTML, try declaring the encoding that you are using like this: (assuming that you are using the UTF-8 character encoding)
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

If you are using Windows and edit a document with a regular text editor then it is probably using the Windows-1252 encoding. Many text editors including even Notepad now have an option to save documents in UTF-8 encoding, which can be better for interoperability. Also, please note that character encoding issues are generally easier to make sense of when using XML/XHTML, which has a well-defined character encoding declaration, as opposed to HTML, which is a lot more ad hoc in this area.