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 905137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:09:59+00:00 2026-05-15T16:09:59+00:00

I am adding UTF-8 data to a database in Django. As the data goes

  • 0

I am adding UTF-8 data to a database in Django.

As the data goes into the database, everything looks fine – the characters (for example): “Hello” are UTF-8 encoded.

My MySQL database is UTF-8 encoded. When I examine the data from the DB by doing a select, my example string looks like this: ?Hello?. I assume this is showing the characters as UTF-8 encoded.

When I select the data from the database in the terminal or for export as a web-service, however – my string looks like this: \u201cHello World\u201d.

Does anyone know how I can display my characters correctly?

Do I need to perform some additional UTF-8 encoding somewhere?

Thanks,
Nick.

  • 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-05-15T16:10:00+00:00Added an answer on May 15, 2026 at 4:10 pm
    u'\u201cHello World\u201d'
    

    Is the correct Python representation of the Unicode text “Hello World”. The smartquote characters are being displayed using a \uXXXX hex escape rather than verbatim because there are often problems with writing Unicode characters to the terminal, particularly on Windows. (It looks like MySQL tried to write them to the terminal but failed, resulting in the ? placeholders.)

    On a terminal that does manage to correctly input and output Unicode characters, you can confirm that they’re the same thing:

    Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> u'\u201cHello World\u201d'==u'“Hello World”'
    True
    

    just as for byte strings, \x sequences are just the same as characters:

    >>> '\x61'=='a'
    True
    

    Now if you’ve got \u or \x sequences escaping Python and making their way into an exported file, then you’ve done something wrong with the export. Perhaps you used repr() somewhere by mistake.

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

Sidebar

Ask A Question

Stats

  • Questions 502k
  • Answers 503k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is done relatively simple. In your titanium project inside… May 16, 2026 at 2:45 pm
  • Editorial Team
    Editorial Team added an answer Try this... example taken from MSDN and amended slightly to… May 16, 2026 at 2:45 pm
  • Editorial Team
    Editorial Team added an answer I don't claim this is particularly elegant, but worked in… May 16, 2026 at 2:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm adding data from a csv file into a database. If I open the
I have to store hindi text in a MySQL database, fetch it using a
Hi I am trying to store names into an Oracle database and fetch them
Is adding tablespaces to a database decrease the performance of an Oracle 9 database?
When adding an item in my database, I need it to auto-determine the value
I'm having an issue with LINQ2Sql where the value in the database is not
Probably I'm doing something wrong but here it goes: I'm trying to create a
When adding a command to the extension org.eclipse.ui.commads , there is a field '
When adding a work item to TFS 2010 via the SDK, the incidents are
How can I change the codepage I want to use on an operation such

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.