Last modified: 2011-07-29 19:27:46 UTC
Hi, I am having a major rendering issues with our website. The statements has returned to use with some un-escaped data. For example: newline -> \012, tab -> \001. The problem is the range of the hex number has been limited to 13-128. All the other octal code will not be translated correctly. I have been found out that the page_content inside the database uses UTF8 text type and the value_blob in smw_text2 table uses bytea. It seems to be that the database is unable to escape my property value and turn it back into utf8 while I am retrieving it from the database. Can some one help me to enable the escape in postgre? Or is there a filter I can apply in SMW code that convert those octal back into binary? Thanks, here are the version of software I have install in the server: Mediawiki: 1.15.5-1~bpo50+1 PostgreSQL: 8.3.13 PHP: 5.2.6-1+lenny10 (apache2handler) Semantic MediaWiki: 1.5.6
The problem has been fix by adding an escape sequence at the print out function. It turns out that the postgres will not do the escape automatically and you have to use pg_unescape_bytea() function to do it yourself. The fix is: 1.open the SMW_QueryPrinter.php contain in the semantic mediawiki includes folder 2.in getResult() function(line 129), add the following line at the end: $result = pg_unescape_bytea($result); for more information, please refer to http://php.net/manual/en/function.pg-unescape-bytea.php
Patch applied in r93327. Sorry for the wait, and thanks for the fix!
*** Bug 30090 has been marked as a duplicate of this bug. ***