473,407 Members | 2,676 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,407 software developers and data experts.

Unicode Hell

I'm trying to do something seemingly easy yet it is proving incredibly
frustrating. Perhaps it is due to my relatively new acquaintance with
Python. In a web environment (ASP with python scripting) I have one form
posting information to another form. The contents of the posting variable
(lets call it cVal1 for simplicity) is non ascii characters, lets say
for example.

On the second page a simple:

cVal1 = Request("cVal1 ")

Response.Write(cVal1)

Writes the values to the screen correctly.

What I really want to do is replace a field place holder with those values.

So if we have a string

cReplaceString = "I want to replace #here#"

I'd like to replace the #here# with the values of a (or )

Please help

Regards

Stuart
Jul 18 '05 #1
1 1916
Stuart schrieb:
What I really want to do is replace a field place holder with those values.
So if we have a string
cReplaceString = "I want to replace #here#"
I'd like to replace the #here# with the values of a (or ߁)


# assign a unicode literal (u"...") to cReplaceString:
cReplaceString = u"I want to replace #here#"
cNewString = cReplaceString.replace(u"#here#",u"")

Perhaps you have to ecncode the chineses characters like \uabcd
whith a,b,c,d as hex digits. My editor has problems with chinese
characters.

Mit freundlichen Gruessen,

Peter Maas

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail pe********@mplusr.de
-------------------------------------------------------------------
Jul 18 '05 #2

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

Similar topics

8
by: Francis Girard | last post by:
Hi, For the first time in my programmer life, I have to take care of character encoding. I have a question about the BOM marks. If I understand well, into the UTF-8 unicode binary...
2
by: monkey | last post by:
Hi all, which should be install? Really confused @@... Is that mean unicode version used for programming in language other than English?
1
by: Mr BigSmoke | last post by:
I'm using chaco in an application that draw some grafs and plot. I really NEED to write unicode strings as a title (PlotTitle) and labels(PlotLabels) i my axis. The problem is that chat (and it's...
15
by: John Salerno | last post by:
Forgive my newbieness, but I don't quite understand why Unicode is still something that needs special treatment in Python (and perhaps elsewhere). I'm reading Dive Into Python right now, and it...
2
by: willie | last post by:
John Machin: # I'll go ahead and concede defeat since you appear to be on the # verge of a heart attack :) # I can see that I lack clarity so I don't blame you. # By UTF-8 string, I mean...
1
by: Michael J. Fromberger | last post by:
I'm not sure whether this is a bug, or a feature that I do not fully understand. I would therefore appreciate some advice, if you have any, on the following problem: I have just installed...
17
by: Stuart McGraw | last post by:
In the announcement for Python-2.3 http://groups.google.com/group/comp.lang.python/msg/287e94d9fe25388d?hl=en it says "raw_input(): can now return Unicode objects". But I didn't see anything...
9
by: thijs.braem | last post by:
Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The error I keep having...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
13
by: damonwischik | last post by:
I'd like to print out a unicode string. I'm running Python inside Emacs, which understands utf-8, so I want to force Python to send utf-8 to sys.stdout. From what I've googled, I think I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.