Forum OpenACS Q&A: Re: a problem with tcl and ascii > 127

Collapse
Posted by Jonathan Ellis on
Thanks, that helps.  Specifying charset=utf-8 does work.

It's a less than ideal solution though for my purposes for two reasons.  First, it behaves differently under rl_returnz: there, $s2 displays correctly, but $s is something funky.  (Both display the umlauted e with vanilla ns_return.)  There are many places where I'm just pulling strings out of the database and writing them out so funkifying those is a poor option. :)  And I'd prefer to avoid experimenting with recreating my database with a different encoding.

Second, I'd rather not have to go change all my text/html to "text/html; charset=utf8", and I'd also rather not write a wrapper that ignores the content-type.

So although I admit it's ugly as hell I'd rather modify my ad_space_to_nbsp proc to keep the same encoding.  There may be one or two other procs that use regsub et al that I'd need to modify but not very many.  Is there a way to do this?  I tried

[encoding convertto iso8859-1 [ad_space_to_nbsp $s]]

but that didn't help.  probably not surprisingly to you. :)

Collapse
Posted by Jeff Davis on
Which version of rl_returnz are you using?  I have a version
modified to be encoding aware which might fix this; the
vanilla version does not bother to change the internal encoding to whatever external encoding you have set.
Collapse
Posted by Jamie Rasmussen on
Jeff, do you know if your encoding-aware changes made it into the SourceForge copy of rl_returnz (renamed nsreturnz)?