1

I am doing an http request with Flutter. The response body text for foreign language is broken. Here is the result for flutter: enter image description here

Of which it should be something like this: enter image description here

The language in question is Korean. Here is my http request code:

  fetchJobs() async {
   var response = await http.get(Global.apiurl + 'jobs/');
    if (response != null && response.statusCode == 200) {
      print(response.body);
      JobResultModel jsonResponse =
          JobResultModel.fromJson(jsonDecode(response.body));
      return jsonResponse.results;
    }
 }

1 Answer 1

4

try

import 'dart:convert';

end use

jsonDecode(utf8.decode(response.bodyBytes))

instead of

jsonDecode(response.body)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.