Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7919821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:59:33+00:00 2026-06-03T15:59:33+00:00

While trying to process a JSON response with GSON (the output is from the

  • 0

While trying to process a JSON response with GSON (the output is from the flickr API in case you’re asking) I encountered what I’d describe as a pretty weird encoding of certain special chars:

Original JSON response

Here’s a hex view of it:

Hex View of Original JSON response

The ‘u’ followed by the ‘double-dots’ is what’s supposed to be a German ‘ü’, and this is where my confusion starts. It’s as if someone took the char and ripped it in half, encoding each of the 2 pieces. The following image shows the hex encoding of what I’d expect it to be in case the ‘ü’ was correctly encoded:

Expected Hex View

Even more weird, in cases where I would expect problems to occur (namely, the Asian character set) everything seems to work fine, e.g. “title”: “ナガレテユク・・・”

Questions:

  1. Is that some flickrAPI oddity or correct JSON encoding for the reposonse? Or is it rather correctly encoded JSON and it’s GSON that’s failing to ‘re-assemble’ this response into the original ‘ü’. Or did the author of the title message simply screw it on his part?
  2. How do I solve the problem (in case it’s either JSON or GSON that’s messing around, can’t obviously do anything if it was the author). How do I know what ‘other’ chars are affected (ö and ä come to mind, but there are probably more ‘special cases’).
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:59:35+00:00Added an answer on June 3, 2026 at 3:59 pm

    What you’re seeing there is a case of Unicode decomposition:

    Characters like German umlauts can be expressed in two ways:

    • the more traditional precomposed form as a single character ü or
    • in decomposed form as base character u followed by a combining diaeresis ̈_ (I had to use an underscore here to make it show up because it’s not supposed to stand alone, it’s really just the to “hovering dots”)

    If you receive something like this, it’s easily converted into precomposed form by using java.text.Normalizer (available since Java 1.6):

    String decomposed = "Mitgef\u0308hl";
    printChars(decomposed); // Mitgefühl -- [M, i, t, g, e, f, u, ̈, h, l]
    String precomposed = Normalizer.normalize(decomposed, Form.NFC);
    printChars(precomposed); // Mitgefühl -- [M, i, t, g, e, f, ü, h, l]
    
    // Normalizing with NFC again doesn't hurt:
    String precomposedAgain = Normalizer.normalize(precomposed, Form.NFC);
    printChars(precomposedAgain); // Mitgefühl -- [M, i, t, g, e, f, ü, h, l]
    ...
    
    static void printChars(String s) {
      System.out.println(s + " -- " + Arrays.toString(s.toCharArray()));
    }
    

    As you can see, applying NFC to an already precomposed string doesn’t hurt.

    Note that printing the String will look correctly on any Unicode-capable terminal, only if you print the character array you see the difference between decomposed and precomposed form.

    A possible source might be MacOS that tends to encode things in decomposed form, it’s curious that Flickr doesn’t normalize this stuff, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to download some JSON from the google book API. The URL
I'm getting this error from Mono's wsdl utility while trying to process eBay's WSDL
With Google Apps API , While trying to automate the process of label creation
I am trying to show a progress bar while my process is going on...in
I am trying to show a progress bar while my process is going on...in
I'm trying to process a large gzip file pulled from the internet in python
I'm trying to figure out how to POST JSON from Android by using HTTPClient.
while trying to process some user input which contains characters such as <. I
I'm trying to parse the json signed_request you receive from Facebook in perl but
I am trying to process somewhat large (possibly up to 200M) JSON files. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.