How can I configure encoding in Maven?

OK, I have found the problem. I use some reporting plugins. In the documentation of the failsafe-maven-plugin I found, that the <encoding> configuration – of course – uses ${project.reporting.outputEncoding} by default. So I added the property as a child element of the project element and everything is fine now: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> See also … Read more

Character with byte sequence 0x9d in encoding ‘WIN1252’ has no equivalent in encoding ‘UTF8’

The problem is that 0x9D is not a valid byte value in WIN1252. There’s a table here: https://en.wikipedia.org/wiki/Windows-1252 The problem may be that you are importing a UTF-8 file and postgresql is defaulting to Windows-1252 (which I believe is the default on many windows systems). You need to change the character set on your windows … Read more

How to put an encoding attribute to xml other that utf-16 with XmlWriter?

You need to use a StringWriter with the appropriate encoding. Unfortunately StringWriter doesn’t let you specify the encoding directly, so you need a class like this: public sealed class StringWriterWithEncoding : StringWriter { private readonly Encoding encoding; public StringWriterWithEncoding (Encoding encoding) { this.encoding = encoding; } public override Encoding Encoding { get { return encoding; … Read more