From e71316b534341b48b58a6a2a5fb39baf63d64820 Mon Sep 17 00:00:00 2001 From: Martin Danielsson Date: Fri, 11 Nov 2016 10:53:54 +0100 Subject: [PATCH] Fix java code highlighting (needs extra empty lines to work correctly) --- _posts/2016-11-11-Using-HALBuilder-with-german-characters.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_posts/2016-11-11-Using-HALBuilder-with-german-characters.md b/_posts/2016-11-11-Using-HALBuilder-with-german-characters.md index 934e526..ba7e503 100644 --- a/_posts/2016-11-11-Using-HALBuilder-with-german-characters.md +++ b/_posts/2016-11-11-Using-HALBuilder-with-german-characters.md @@ -30,13 +30,17 @@ These days I was doing some updates on the Meinkonto RESTful API using this HAL Basically this library is very robust and we are using it without any major impediments for generating and consuming HAL resources in pure Java, but seems to have some flaws in working with UTF-8 encoded special characters. For instances of + ```java com.theoryinpractise.halbuilder.api.Representation ``` + they provide this method + ```java toString(RepresentationFactory.HAL_JSON) ``` + for generating the JSON string from a `JsonRepresentation `object. Unfortunately for strings with German characters the outcome is not quite the expected one, i.e. "ä" becomes "ä" and so on. Searching the documentation, some relevat tech forums and codebase, I was not able to find a way to specify the correct encoding, thus I've ended using the following construction.