Help with windows clipboard and accented characters

S

Stephen Boulet

This little script used to work but now does not:

import win32clipboard,sys,re

s = 'André'

# Paste string to clipboard
win32clipboard.OpenClipboard(0)
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(s)
win32clipboard.CloseClipboard()

Now I get this on the clipboard:

André

How can I fix this?

Stephen
 
L

Larry Bates

Works on my system (Windows XP Pro, Python 2.2).
I run this, open MS Word, select EDIT-PASTE and
André is pasted in perfectly.

FYI,
Larry Bates
Syscon, Inc.
 
S

Stephen Boulet

That's bizarre. I did upgrade to python 2.3.4 and pywin32-202. Maybe
that had something to do with it.

Stephen
 
T

Terry Reedy

Stephen Boulet said:
This little script used to work but now does not:
s = 'André'

If you have non-ascii chars in string literals in 2.3+, I believe you need
the coding comment at the top of the file. The 2.3 what's new should say
something.

tjr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top