Forum OpenACS Development: Re: User Smart Search Widget with Ajax

Collapse
Posted by Ryan Gallimore on
Hi Eduardo,

I'm happy to hear my widget was helpful to you. What kind of encoding problems are you having? What do your search results look like?

Ryan

Collapse
Posted by Eduardo Santos on
In the results box, everytime I have a Latin character, such as á or ç I see this in the result: �

Do you have any ideas on how to fix it?

Collapse
Posted by Ryan Gallimore on
It seems to me that you need to quote the string returned by search-users.tcl. But it might be more complicated than that.

My understanding of character encoding is a bit hazy, but this (old) thread might help:

https://openacs.org/forums/message-view?message_id=28543

Good luck

Ryan

Collapse
Posted by Eduardo Santos on
Thank you very much for you help again, Ryan. Afther a long research, I found the answer in the link that you gave me. I've changed the following line in the search-users.tcl file:

ns_write [encoding convertto utf-8 $response]

I'm forcing the encoding to be utf-8. It seems to me like ns_write is ignoring the server's encoding (possibly an AOLServer bug). In your standard exit:

ns_write $response

the HTML response to the browser gets the wrong encoding, but the ns_log command, for example, has the right server encoding. It's an workaround but it's working.