Forum OpenACS Q&A: Response to Bboard mutltibyte topic failure

Collapse
Posted by Kenny Chiang on

Found the problem.

In bboard module (and serveral other modules indeed), it uses [ns_conn form] to pass the ns_set variables to util_prepare_xxx (update, insert) to prepare the sql string instead of [ns_getform] which will do the proper charset encoding conversion.

My solution, for now, is just replace what ever [ns_conn form] to [ns_getform] and preceded it with a ns_setformencoding "big5", e.g. :

ns_setformencoding "big5"
set sql [util_prepare_update $db bboard_topics "topic_id" $topic_id [ns_getform]]

Does anyone have any better solutions ?