Encoding::UndefinedConversionError
menu.to_s.encode(‘UTF-8’, invalid: :replace, undef: :replace, replace: ‘?’) This worked perfectly, I had to replace some extra characters but there are no more errors.
menu.to_s.encode(‘UTF-8’, invalid: :replace, undef: :replace, replace: ‘?’) This worked perfectly, I had to replace some extra characters but there are no more errors.
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
The IANA character set registry says: no distinction is made between use of upper and lower case letters. But that page, the XML specification, and unicode.org are consistent about capitalizing UTF-8.
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
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
This depends on what program is opening the example.csv file. Using a text editor, the encoding will be UTF-8 and the characters will not be malformed. But using Excel the default encoding for CSV is ANSI and not UTF-8. So without forcing Excel using not ANSI but UTF-8 as the encoding, the characters will be … Read more
File.open(yml_file, ‘w’) should be change to File.open(yml_file, ‘wb‘)
It looks like this is part of the ruby-mode in emacs. I found a link to an article that shows how to edit the ruby-mode.el file. Not sure if it works, but there is also a comment on that article that may work better: (setq ruby-insert-encoding-magic-comment nil) If instead of using ruby-mode your are using … Read more
git is dumping out raw bytes. In this case, it doesn’t care what your file’s encoding is. The highlighted <F6> you’re seeing is coming from less, which is presumably configured as your PAGER. Try setting: LESSCHARSET=UTF-8