Forum OpenACS Q&A: Re: Problems with Microsoft char set (eg 'smart quotes') in form input

Sorry to dredge up this old topic, but I can't seem to get either the demoroniser code or Stan's decruft code to replace the MS characters.  I typed "hello" in MS Word and copy/pasted it into a form I created.  I logged the before and after the "conversion" values of the string and they showed:

Before: \x93hello\x94
After: \xef\xbe\x93hello\xef\xbe\x94
(\x93 and \x94 are the MS smart quotes)

It looks like the code to replace the MS characters is adding more junk instead of removing them.  I can't figure out what is wrong.  I even stripped down the proc to search only for \x93 and it still adds the garbage.

set some_string [string map {x93 {"}} $some_string]

I'm using AOLServer 4.0 with TCL 8.4.

I would appreciate any help or insights.  Thanks!

Gilbert