Summary | Charset trouble when saving page names in db backend |
Queue | Wicked |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | chuck (at) horde (dot) org |
Requester | lfbm.andamentos (at) gmail (dot) com |
Created | 12/24/2008 (6074 days ago) |
Due | |
Updated | 12/31/2008 (6067 days ago) |
Assigned | 12/28/2008 (6070 days ago) |
Resolved | 12/31/2008 (6067 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Assigned to Chuck Hagenbuch
State ⇒ Resolved
http://cvs.horde.org/diff.php/wicked/lib/Driver/sql.php?rt=horde&r1=1.81&r2=1.82&ty=u
New Attachment: patch.txt
handling, specially getPages() and renamePage() functions.
As I was already changing it, I also added two functions
(_convertToDriver() and _convertFromDriver()), and then altered all
the long String::convert..., in order to make the file more readable,
following the same style as Turba driver.
Renaming pages with special chars works just fine now, as also
permissions are working great.
The patch is attached.
Thanks.
field in the db.
I saved data in both situations (when charset for the page_name field
is latin1_swedish_ci - the default - and when it is utf8_unicode_ci).
In any case, the data (page name) will be saved correctly only when
using the patched sql.php.
But when using the patched sql.php, then a lot things break, like the
inability to identify already created pages (which, by consequence - I
think - breaks the identification of a renamed page during rename
operation).
This shows why pages are not identified as already created:
http://img377.imageshack.us/img377/504/variablesbn0.jpg
Also, permissions get troubled, because page names are displayed incorrectly:
http://img367.imageshack.us/img367/6181/permsgn5.jpg
Taken from Chuck Hagenbuch
it fixes the problem.
just fine: 'Tributário', but the $list array, which is pulled from
$this->getConf('pages') returns the page name as 'Tribut�rio',
thus making the test "$exists = in_array($page, $list)" fail (line 76
of Wikilink.php).
The page_name, after the patch provided in this bug report, is saving
correctly in the db (like 'Tributário'). The table's default charset
is latin1.
Asking on #php, I was told I should change de charset of the table's
fields to UTF-8.
I'm confused, because fields on my turba_objects table, for example,
are also latin1 and I never had trouble concerning arbitrary
characters on them. And, on the other hand, phpMyAdmin are capable of
displaying the page_names on wicked_pages table just fine, what makes
me guess this is something that can be handled on the fly, through
php, without any db fields attributes changing.
If that's the case, is this a task for wicked or for Text_Wiki? Or
should I really change the db field charset?
getting Text_Wiki to even identify page names with unicode characters
in them.
This is my wikihome. Both 'Penal' and 'Tributário' pages exist, but
the link for 'Tributário' is still red (although it works if clicked):
http://img136.imageshack.us/img136/8862/wikihomefp4.jpg
This is the 'Tributário' page. After the patch, the name is displayed
correctly and also in the db the name is correctly saved:
http://img171.imageshack.us/img171/7743/tributarioez1.jpg (page screenshot)
http://img525.imageshack.us/img525/4858/dbny6.jpg (Database screenshot)
And when searching for 'Tributário', it works flawlessly, but still
there's the same red coloured link problem in the results page:
http://img230.imageshack.us/img230/7728/searchue3.jpg
getting Text_Wiki to even identify page names with unicode characters
in them.
already created.
PS: Pages without any special chars (created before or afeter the
patch) are recognized just fine.
created before the patches, so they can still be opened. It's working.
The trouble are the 'red' links.
already created.
PS: Pages without any special chars (created before or afeter the
patch) are recognized just fine.
State ⇒ Feedback
page with special characters in the name as "already created", thus
making the link to it red (as if the page didn't exist), although you
can open the page normally.
State ⇒ Resolved
Assigned to Chuck Hagenbuch
http://cvs.horde.org/diff.php/wicked/docs/CHANGES?rt=horde&r1=1.88&r2=1.89&ty=u
http://cvs.horde.org/diff.php/wicked/lib/Driver/sql.php?rt=horde&r1=1.80&r2=1.81&ty=u
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Charset trouble when saving page names in db backend
Type ⇒ Bug
Queue ⇒ Wicked
Wicked 1.0-cvs
When I create a page with special characters in the name, like
"Circunstância", the page is saved in my database as "Circunstância".
It would be better to get the names saved exactly as they were wrote
(like in Turba), due to future migrations and even manual query
activities.
If I change line 616 of wicked/lib/Driver/sql.php from '$pagename,' to:
'String::convertCharset($pagename, NLS::getCharset(), $this->getCharset()),'
Then the page name is saved ok in my db backend.
But then when displaying the page name in the application I get:
'Circunst�ncia'
Thanks