User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 426,319 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,304 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 2339 | Replies: 5
Join Date: Aug 2005
Location: Bosnia and Herzegovina
Posts: 147
Reputation: Micko is on a distinguished road 
Rep Power: 4
Solved Threads: 1
Micko Micko is offline Offline
Junior Poster

Handle unicode characters

  #1  
Aug 20th, 2005
Hello, I've downloaded PythonWin as a better IDE for writing Python code.
I came across an interesting issue (as vegaseat pointed out)
When I try to write this sentence in my native language
"Ja sam Ä?iÄ?a Ä?vorak!"
PythonWin automatically convert my language's charater to something other because it cannot handle them. However if I start Python default IDE (which came with installer - IDLE) this code works fine

# -*- coding: cp1250 -*-
str1 = u"Ja sam Ä?iÄ?a Ä?vorak!"
print str1 

How this is possible? Do IDE's yuse different font or what?
HOW IT IS POSSIBLE THAT ONE EDITOR SHOWS CORRECT CHARACTER AND OTHER DOESN'T?
I must admit that I don't understand how to use UNICODE and will UNICODE will help at all?

if I copy that changed text form PythonWin and paste it here changed characters are back again in what I've expected.

Maybe because of your windows local settings you cannot see exact characters, that's why I send two pictures.

I hope someony can clearfy this

Thanks
Attached Images
File Type: jpg Changed_pythonWin.jpg (8.6 KB, 3 views)
File Type: jpg Correct_IDLE.jpg (10.5 KB, 4 views)
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 10:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC