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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:10:47+00:00 2026-05-26T12:10:47+00:00

code a = 한글 #korean language a_list = [] a_list.append({‘key’: a}) print a_list result

  • 0

code

 a = "한글" #korean language
 a_list = []
 a_list.append({'key': a})
 print a_list

result

[{'key': u'"\ud55c\uae00"'}]

I don’t want to convert unicode.
How can I stay in korean language
I wish to print like this

 [{'key': '한글'}]
  • 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-26T12:10:47+00:00Added an answer on May 26, 2026 at 12:10 pm

    Your code from the question produces:

    [{'key': '\xed\x95\x9c\xea\xb8\x80'}]
    

    This output is different from what you have shown in the question.

    To produce: [{"key": "한글"}] you could use json:

    print json.dumps(a_list, ensure_ascii=False, encoding=your_source_code_encoding)
    

    Full example

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    import json
    
    a = "한글" # you should use u"" literals to work with Unicode strings
    a_list = []
    a_list.append({'key': a})
    
    print json.dumps(a_list, ensure_ascii=False) # "utf-8" encoding is default
    

    Output

    [{"key": "한글"}]
    

    You wrote:

    I dont want to convert unicode. How can I stay in korean language

    Read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!).

    The main takeaway is if you are working with text you must specify its encoding.

    The most convenient and reliable way is to use Unicode strings throughout your program i.e., decode bytes that you read to Unicode strings as early as possible on input and encode to bytes while writing Unicode strings as late as possible on output.

    To enforce that convention all strings are Unicode in Python 3. Python 2 unfortunately allows you to use bytestrings for both text and data with all confusion that it causes.

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

Sidebar

Related Questions

Code like this often happens: l = [] while foo: # baz l.append(bar) #
<head> <script language=javascript type=text/javascript src=http://code.jquery.com/jquery-1.4.1.min.js></script> <script language=javascript type=text/javascript> $(function() { $(#MoveRight,#MoveLeft).click(function(event) { var id
Code sample: for file in files: do_something(root+file) I want to replace file with f
I have started to code a multi-language feature for a medium-sized website with a
I'm using this code to store korean string in my database: Dim username As
I am working with allegro 4.4 library. When I print a Korean character, the
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
Code: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title>Unusual Array Lengths!</title> <script type=text/javascript> var arrayList = new Array();
Code I have: cell_val = CStr(Nz(fld.value, )) Dim iter As Long For iter =
Code and preview: <html> <head> <title>Testing some CSS</title> <style type=text/css> .dDay { font-size:205% }

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.