473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

python unicode display of chinese characters

Hi,

I've done some google searching w/c referred me to a couple of
articles on unicode, but I'm looking for something really simple - not
for a web application.

See my sample code below. Any ideas how to convert it to display
maybe Simplified Chinese ?

Rgds,
Dennis

================================================== ==
#ucode.py

#get unicode number
ucode_num = str(raw_input('Enter the string : '))

#define constants
encode_type = 'utf-8'
display_type = 'cp-347' #for IBM consoles

#define unicode
character_display = unicode(ucode_num, encode_type)
#print character to be displayed
print character_display.encode(display_type)

Jul 18 '05 #1
1 6944
> "Posadas, Dennis" <de************@intel.com> wrote in message news:<ma***********************************@python .org>...
Hi,

I've done some google searching w/c referred me to a couple of
articles on unicode, but I'm looking for something really simple - not
for a web application.

See my sample code below. Any ideas how to convert it to display
maybe Simplified Chinese ?


The first idea is to debug input and output separately, i.e. save
your Chinese text to utf-8 file in a Chinese-aware editor. Read
it from your Python program and try to display.
You're trying to use cp347 encoding, did you install it? My
python installation does not have it.
What console do you use? Are you sure it supports cp347?

-- Serge.

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: carroll | last post by:
Does wxPython handle Unicode strings (specifically, Unihan strings, with Chinese characters) easily? I'm writing an app to help me explore the Chinese character sets, and can do basic displays...
1
by: Daman | last post by:
Hi, I am currently facing difficulty displaying chinese, japanese, russian etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2 unicode database (UTF-8). The resultset that...
12
by: Onega | last post by:
Hi I create a simple win32 project (VC2003, windows2003(English) , and do simple paint in WM_PAINT message, when the project use multi-character set, it is OK. but when I change to UNICODE,...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
3
by: Jennifer | last post by:
Hi, Is there anyone to have idea how to make the MFC CDialog box display Unicode (like Chinese characters) in .NET 2005? We have some dilog boxes created from CDialog class in VC++ 6.0 and try...
7
by: kernel1983 | last post by:
I'm try to build a bundle on OS X, so I write a simple python script for a test: #!/usr/bin/env python import EasyDialogs EasyDialogs.Message("Hello,Mac!") This runs OK,but when I try to...
9
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
OK I have some Chinese text in sql server column that looks like this: 12大专题调研破解广东科学发展难题 This is unicode? Anyway, I put this data into a text area like this:...
13
by: Liang Chen | last post by:
Hope you all had a nice weekend. I have a question that I hope someone can help me out. I want to run a Python program that uses Tkinter for the user interface (GUI). The program allows me to type...
0
by: Terry Reedy | last post by:
Liang Chen wrote: Start with the Unicode HOWTO in the HOWTOs part of the Manual set. For 2.6 http://docs.python.org/howto/unicode.html For 3.0, which has been updated in spite of the warning...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.