What is the most efficient binary to text encoding?

This really depends on the nature of the binary data, and the constraints that “text” places on your output. First off, if your binary data is not compressed, try compressing before encoding. We can then assume that the distribution of 1/0 or individual bytes is more or less random. Now: why do you need text? … Read more

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

How to configure CharacterEncodingFilter in SpringBoot?

Since Spring Boot 1.4.2 registering your own CharacterEncodingFilter will work ONLY IF you disable Spring’s own instance of this bean by setting spring.http.encoding.enabled=false in the application.properties. However, one can resolve this matter without any Filter instantiation by adding these setting to the application.properties: # Charset of HTTP requests and responses. Added to the “Content-Type” header … Read more

Easy way to convert a unicode list to a list containing python strings?

Encode each value in the list to a string: [x.encode(‘UTF8′) for x in EmployeeList] You need to pick a valid encoding; don’t use str() as that’ll use the system default (for Python 2 that’s ASCII) which will not encode all possible codepoints in a Unicode value. UTF-8 is capable of encoding all of the Unicode … Read more

Convert .net String object into base64 encoded string

What you’ve provided is perfectly functional. It will produce a base64-encoded string of the bytes of your source string encoded in UTF-16. If you’re asking if UTF-16 can represent any character in your string, then yes. The only difference between UTF-16 and UTF-32 is that UTF-16 is a variable-length encoding; it uses two-bytes to represent … Read more

MySQL treats ÅÄÖ as AAO?

Yes, this is standard behaviour in the non-language-specific unicode collations. 9.1.13.1. Unicode Character Sets To further illustrate, the following equalities hold in both utf8_general_ci and utf8_unicode_ci (for the effect this has in comparisons or when doing searches, see Section 9.1.7.7, “Examples of the Effect of Collation”): Ä = A Ö = O Ü = U … Read more