The search in Arabic does not work i.e did not find any even there are names in there.
In English it went well.
Any assistance
Bests
Hi @qassim_nasir,
Are you using English UI when searching in Arabic? It should work if you use Arabic UI.
Regards, Primož
Yes we are using Arabic and search is not working
We noticed that the data is sent using urlencoding when Arabic characters are entered
Bests
I meant Arabic UI and the search in Arabic as well., we are using OJS 3.1.2.1 .
To clarify the problems, I attached the search bar content (in Arabic) and how the GET command look like 
Hi @qassim_nasir,
When you try to search for an Arabic name, do you see the spinner turning endlessly? If so, please check your PHP error log to see if there are any helpful details there.
Regards,
Alec Smecher
Public Knowledge Project Team
Thanks
No endless loop
It returned immediately
Have you seen the GET searchphrase code of GET method when Arabic is used
It is using a surprisingly code e.g. %D9%85%…
it is url encoding, not sure if it is right to do so.
Is the following
[07-Feb-2020 21:41:21 Asia/Dubai] PHP Notice: Undefined variable: contextId in C:\inetpub\wwwroot\spu-uos\lib\pkp\api\v1\users\PKPUserHandler.inc.php on line 291
has any relationship
Also I saw this in php error log
[07-Feb-2020 22:19:49 Asia/Dubai] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\inetpub\wwwroot\spu-uos\cache\t_compile\65bfc3e024c2e9104f46e23b73376a9455e3df0e^51cfb9321c891ada9323e7942962579e7e4324d1_0.app.frontendpagesindexSite.tp.php on line 43
Not sure if related
Hi @qassim_nasir,
The warnings aren’t related, and at least the first one will be fixed in the next release (OJS 3.2). In other words, I don’t see anything relevant there.
I ran a test by adding an Arabic name to an existing reviewer who already had an English-language name, then searching in the interface for both English and Arabic names. In both cases the reviewer came up correctly.
The urlencoding you’ve noted is indeed correct – even though it looks long/strange.
I’m afraid it’s hard to debug further without being able to replicate the problem on my own machine, but I’d suggest checking to see if you can search for small pieces of the user’s name. It’s possible that there are UTF-8 code sequences within the user’s name, or the segment of the name you’re searching for, that are causing problems.
Regards,
Alec Smecher
Public Knowledge Project Team
Thanks, but we searched even for one character. Do you think IIS which we use need some thing to change in.
Appreciate your kind assistance.
Hi @qassim_nasir,
If you can search successfully for basic Latin characters, but not non-Latin characters (like Arabic), then I suspect you have a problem with character encodings. To debug this further, you’ll need to figure out what is being asked of the database. I think the best way will be to set up a query log directly with MySQL (search e.g. Google for “mysql query log” for information on this). Then you can see what OJS is querying the database for, and debug why no results are appearing for it.
Regards,
Alec Smecher
Public Knowledge Project Team
Thanks, we saw what stored in DB, I believe it is in UTF8 format as attache.
Hi @qassim_nasir,
What do you have for the following settings in your config.inc.php
configuration file?
client_charset
connection_charset
database_charset
Regards,
Alec Smecher
Public Knowledge Project Team
Here it is
; Default locale
locale = ar_IQ
; Client output/input character set
client_charset = utf-8
; Database connection character set
; Must be set to “Off” if not supported by the database server
; If enabled, must be the same character set as “client_charset”
; (although the actual name may differ slightly depending on the server)
connection_charset = utf8
; Database storage character set
; Must be set to “Off” if not supported by the database server
database_charset = utf8
I enabled the log file and found the queries
(lower(u.username) LIKE ‘%ù…øù…ø¯%’ or lower(u.email) LIKE ‘%ù…øù…ø¯%’ or (us
.setting_name
= ‘givenName’ and lower(us.setting_value) LIKE ‘%ù…øù…ø¯%’) or (us
.setting_name
= ‘familyName’ and lower(us.setting_value) LIKE ‘%ù…øù…ø¯%’) or (us
.setting_name
= ‘affiliation’ and lower(us.setting_value) LIKE ‘%ù…øù…ø¯%’) or (us
.setting_name
= ‘biography’ and lower(us.setting_value) LIKE ‘%ù…øù…ø¯%’) or (us
.setting_name
= ‘orcid’ and lower(us.setting_value) LIKE ‘%ù…øù…ø¯%’) or lower(cves.setting_value) LIKE ‘%ù…øù…ø¯%’) and (lower(u.username) LIKE ‘%ùƒù…ø§ù„%’ or lower(u.email) LIKE ‘%ùƒù…ø§ù„%’ or (us
.setting_name
= ‘givenName’ and lower(us.setting_value) LIKE ‘%ùƒù…ø§ù„%’) or (us
.setting_name
= ‘familyName’ and lower(us.setting_value) LIKE ‘%ùƒù…ø§ù„%’) or (us
.setting_name
= ‘affiliation’ and lower(us.setting_value) LIKE ‘%ùƒù…ø§ù„%’) or (us
.setting_name
= ‘biography’ and lower(us.setting_value) LIKE ‘%ùƒù…ø§ù„%’) or (us
.setting_name
= ‘orcid’ and lower(us.setting_value) LIKE ‘%ùƒù…ø§ù„%’) or lower(cves.setting_value) LIKE ‘%ùƒù…ø§ù„%’) group by u
.user_id
LIMIT 0,15
Surprising characters.
By the way we use IIS as web server
Hi @qassim_nasir,
As long as everything is properly UTF8-encoded end to end, it shouldn’t matter whether you’re using IIS or Apache.
There does appear to be something wrong with the character encoding in your search SQL.
I would suggest checking what the request looks like using your browser’s developer tools. For example, when searching for a name with the browser’s network tools open, I can see it log a request like this…
As you can see, the Arabic text is represented readably.
If I hover the mouse over that request, I get more details:
This shows me both the readable UTF-8, and the URL-encoded equivalent.
Regards,
Alec Smecher
Public Knowledge Project Team