473,320 Members | 1,914 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,320 software developers and data experts.

Convert from unicode to int

Hi

Is there any simpler way to convert a unicode numeric to an int than:

int(u'1024'.encode('ascii'))

??

regards tores
Sep 22 '05 #1
2 32977
Tor Erik Sønvisen wrote:
Hi

Is there any simpler way to convert a unicode numeric to an int than:

int(u'1024'.encode('ascii'))

why doesn't:

int(u'104')

work for you?
--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
Sep 22 '05 #2
On 2005-09-22, Tor Erik Sønvisen <to***@stud.cs.uit.no> wrote:
Hi

Is there any simpler way to convert a unicode numeric to an int than:

int(u'1024'.encode('ascii'))

int(u'1024')

1024

Didn't that work for you when you tried it?

--
Grant Edwards grante Yow! FIRST, I'm covering
at you with OLIVE OIL and
visi.com PRUNE WHIP!!
Sep 22 '05 #3

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

Similar topics

23
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner,...
4
by: Julia | last post by:
Hi, I need to convert unicode string to ansi string Thanks in adavance.
2
by: kath | last post by:
Hi, 38938.0 <type 'unicode'> Traceback (most recent call last): File "D:\Python23\Testing area\Python and Excel\xlrdRead.py", line 30, in ?...
6
by: Aneesh E Warrier | last post by:
How can I convert Unicode Codepoint (dec) value to ASCII char? For example: 49324 is 사 a Korean alphabet, and I want to convert it to ASCII letter. Thanks!
0
by: johnlim20088 | last post by:
Hi, Hi, Can anyone tell me how to convert a set of hexcode to displayable unicode? I wish the function can display the correct value in datagrid, and when it is being export to csv, the value...
3
by: ldng | last post by:
Hi, I'm looking for a way to convert en unicode string encoded in UTF-8 to a raw string escaped with HTML Entities. I can't seem to find an easy way to do it. Quote from urllib will only work...
2
by: enginious | last post by:
Hi, I'm not sure if I'm barking up the wrong tree or not, but I gather that there could be potential security flaws by allowing unicode text to form part of an SQL query. Currently to prevent...
9
by: vaskar | last post by:
I have got one problem in VB.NET 2005 using unicode I want to add two numbers in vb.net 2005 through UNICODE I didn't know how to convert UNICODE string to integer. I hope you can solve my...
0
by: Jean-Paul Calderone | last post by:
On Mon, 5 May 2008 16:05:08 +0200, Simon Posnjak <sposnjak@gmail.comwrote: You need to provide some more information about `some_module.some_thing´. How is it implemented? What Python type does...
0
by: M.-A. Lemburg | last post by:
On 2008-07-01 20:31, Peter Bulychev wrote: You could write a codec which translates Unicode into a ASCII lookalike characters, but AFAIK there is no standard for doing this. I guess the best...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.