Skip to content

Tag: encoding

Properly set UTF-8 encoding to a FileHandler in Java

I initialize my FileHandler as follows: and add it to my Logger like this: If i remove the setEncoding on my FileHandler, its sill is wrong. But strangely, if i add the exact same Encoding to my ConsoleHandler, it stops working too. (But without the explicit set, it works at least in my IntelliJ-Console). IntelliJ-Console WITHOUT the explicit encoding (same

Encoding Problem while saving a txt file in utf-8

The follwing line should write a ΓΌ in test.txt encoded in utf-8- At least this is what I expect it to do. But if I open the file in a text editor, the editor shows and the editor states that it would read the file as utf-8. I even tried two editors and both show the same unexpected result. A

Spring Rest Template Injects Value into Parameter with %

Can someone please explain to me what is happening in the following code? If I run: Spring tells me that the URL used is where username = user%25123 even though I set the username = user%123. This is looking to me to be not a Spring issue, rather a URL encoding issue, but can anyone tell me where this

Disable feign encoding of PathVariables

I have the following Feign Client: The items can contains special characters like : or :: which are being encoded. Request URL becomes something like: Rather than: Can anyone help me understand how can we fix this issue? Answer OpenFeign has an issue tracking: Guess it will be implemented by spring-cloud-feign once its done. Meanwhile, my workaround

JSP can’t display Russian characters

I have a JSP file that contains paragraphs with Russian text. However, no matter what I do I can’t get a browser to display that text – instead all I get is hieroglyphs. The same text but in a simple HTML file without any headers or declarations works fine: But the moment I save that file as JSP and try

Is Java 8 java.util.Base64 a drop-in replacement for sun.misc.BASE64?

Question Are the Java 8 java.util.Base64 MIME Encoder and Decoder a drop-in replacement for the unsupported, internal Java API sun.misc.BASE64Encoder and sun.misc.BASE64Decoder? EDIT (Clarification): By drop-in replacement I mean that I can switch legacy code using sun.misc.BASE64Encoder and sun.misc.BASE64Decoder to Java 8 MIME Base64 Encoder/Decoder for any existing other client code transparently. What I think so far and why Based