[pmwiki-users] Search with non-ascii characters in url q= parameter
Petko Yotov
5ko at 5ko.fr
Tue Jan 24 02:37:15 PST 2023
Yes, PmWiki can handle international characters in searches (try on
pmwiki.org), but you may need to enable UTF-8.
See https://www.pmwiki.org/wiki/PmWiki/UTF-8 as this may not be trivial
for existing wikis.
In fact, the browser will use the encoding of your page when it submits
a form. So if your wiki is in the old encoding ISO-8859-1, "ä" will be
encoded as "%E4", if your wiki is in UTF-8, "ä" will be encoded as
"%C3%A4".
The browser's URL bar will show the UTF-8 international characters
decoded (ä), but not the other encodings (%E4). All browsers, all major
search engines, Wikipedia and other popular websites use UTF-8.
I have only recently encountered a Microsoft IIS installation that
refused to correctly decode international characters in pagenames (not
sure about searches) but somehow it worked with CleanURLs.
Petko
On 24/01/2023 10:50, Hans wrote:
> Hello Pmwiki-users,
>
> Normal search using a search box works fine, when the query string
> contains special non-ascii characters.
> For instance searching for pages with "Bär" gets the right results, and
> "Bär" appears in the search box, and in the URL bar I got the entry:
> http://localhost/softflow/test?n=Site.Search&action=search&q=B%E4r
> so the "ä" character is rendered as "%E4".
>
> Using a Context Search add-on (for Firefox) I can grab text with
> non-ascii characters and have that string given to PmWiki as a url q=
> parameter. But PmWiki does not like that, and garbles it.
> In the example the url parameters will read:
> ....?n=Site.Search&action=search&q=Bär
> and the search will fail, and the Search page displays with "Bär" in
> the search box, not the string I want to search for.
>
> The "Select and Search" Firefox add-on is set up for a PmWiki search
> like this:
> http://localhost/softflow/test?n=Site.Search&action=search&q=%s
> In a search the %s gets replaced with a highlighted text string using a
> context menu option to use this add-on with this search option.
>
> So my question is: could PmWiki handle special non-ascii characters in
> url parameters for a search query?
>
> If I use google search engine, it shows no problems with special
> characters being provided via url parameters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20230124/397f0e1a/attachment.html>
More information about the pmwiki-users
mailing list