23483 Posts in 18976 Topics by 2878 members
|Go to End|
19 February 2009 at 8:19am
I found a posting of a user who had problems to search umlauts within a silverstripe page. The problem comes from a setting which should be set in the tinymce configuration. Without this configuration directive tinymce will alway replace umlauts lik 'Ãœ' with their aeuivalent 'Ü' The search tool later on expects to read UTF-8 and can not find the content or displays the content double encoded (here: &Uuml;) in the results list.
Attached you can find a patch which solves this problem. After applying the patch you have to to a /db/build?flush=1 and save all pages containing umlauts in the content again.
@@ -40,6 +40,7 @@
safari_warning : false,
relative_urls : true,
verify_html : true,
+ entity_encoding : "raw",
extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]"
19 February 2009 at 3:04pm
Wouldn't it make more sense to leave the saved data alone and, instead, convert special characters in the search term into HTML entities before doing the search? Just a thought.
19 February 2009 at 9:50pm
As silverstripe is fully utf-8 enabled, there is no need to encode any characters in a special way. Only for html-output purposes the &, < and > characters in text sections must be html-encoded (otherwise the browsers would try to interpret them as html-elements). That's exactly what the setting does (see http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/entity_encoding ).
Storing ans searching works nicely with the patch, and users should be able to handle content in all charactersets without any workarounds.
30 June 2009 at 2:49am
thank you for the tipp. As Silverstripe uses its own configuration, you can set such config vars in the "HtmlEditorConfig"-Class (sapphire/forms/HtmlEditorConfig.php). All settings are defined in the protected property "$settings". They will be packed and sent to the browser.
Note and Question: Its not good style to edit lib-files, because you will get some trouble to upgrade to newer Versions. Is there a chance not to edit a lib file, and create a project related configuration?
30 June 2009 at 3:02am
you are right, but it's the only way I have found to handle that issue; I have opened a ticket http://open.silverstripe.org/ticket/3582 suggesting to set that as default for future releases...
|Go to Top|