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

  • Home
  • SEARCH
  • 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 7729649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:01:08+00:00 2026-06-01T06:01:08+00:00

I have a list which contains dictionaries. Each dictionary has an attribute description which

  • 0

I have a list which contains dictionaries. Each dictionary has an attribute description which should contain a string. When I put this string into the dictionary, I know that it has the right encoding (when printed in the terminal, it looks good). Also, if I print the value of description after it has been set, the string still looks good.
Then I use JSONEncoder.encode(myList) and save I this JSON string to a file using the code below:

file_obj = open("file.txt", "w")
file_obj.write(text)
file_obj.close()

Then, when I open the file characters are shown wrong. E.g. \u00e5, \u00f8d and \u00e6.

Does anyone have an idea why this is and how I can fix this?

  • 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-01T06:01:09+00:00Added an answer on June 1, 2026 at 6:01 am

    JSON encoding is designed to create a string that can be loaded via JSON decoding, which is exactly what it’s doing. “What it looks like when you open the file” is not the same as “what it will look like if you run it through a JSON decoder” – the JSON decoder will also decode the \u#### escapes.

    If you want the file to contain raw unicode, rather than \u#### escapes, don’t use a JSON encoder; that’s not what it’s designed for.

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

Sidebar

Related Questions

I have 2 lists, both of which contain same number of dictionaries. Each dictionary
I have a list which contains a dictionary of ExpandoObjects. Im binding this to
I have a Request object which contains a list of Approvers. An approver has
I have two complex dictionaries in the form Dictionary<string, Dictionary<string, Dictionary<string, List<string>>>> So as
I have a generic list which contains member details and I have a string
I have a list which contains some strings like below: List<String> l = new
I have a list of viewmodels which contains vehicle data such as this public
I have a list view which contains a button in each row of the
I have a List which contains Dates : List<string> StringDates; [0]: 04.03.2010 [1]: 09.03.2010
I have contact list which contains (checkbox,firstname,lastname,phone). I am creating this list using html

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.