This looks like on the Solaris you mention the default character encoding, as is used by String.getBytes(), can not encode the emdash. Consequently the character ends up as a question mark.
Try String.getBytes(
String charsetName) and use "UTF-8" encoding.
Harald.