Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1k views
in Q2A Core by
edited by
Hi,

my problem is that names of users (as displayed next to questions etc.) containing special characters such as "ö" (German) are displayed with cryptic character codes in Q2A. For example, my own name, which should be "lukas_könig" is shown as "lukas_k%c3%b6nig".

My Q2A platform is set up within wordpress. Q2A receives user data from wordpress which in turn gets the users over an LDAP interface, so the names Q2A gets are given from outside. (lukas_könig is not the user name in word press, but given as first and surname, so Q2A seems to construct the name to display by putting a "_" in between.)

I tried to fix the problem by changing the "public name" in wordpress to one without special characters, but it didn't work (although wordpress itself displays special characters correctly). Also, as I am expecting several hundreds of users, I am looking for a more general solution to the problem.

Is there a way to solve this once and for all?

Thanks

Lukas
Q2A version: 1.6.3
by
You haven't clarified if LDAP is returning your username as lukas_könig. Is it?
by
actually no - sorry, i told it wrong! according to the data given in wordpress, the username is a cryptic id. lukas and könig are really given as first and surname. i will change that in my question.
by
Apparently not as easy to solve as i thought first... Really no ideas by anyone?

2 Answers

0 votes
by
edited by
 
Best answer

I found another solution that works. For some reason, wp writes the cryptic character codes only into the "user_nicename" of the "wp_users" table of its database. The "display_name", on the other hand, looks fine.

So I searched for the string "user_nicename" in all qa files and it appears only in "qa-external-users-wp". There, as far as my sql knowledge goes, it only performs read operations on the database. So I found it safe to just

  • replace every occurrence of "user_nicename" with "display_name" in "qa-external-users-wp".

That seems to work fine (displaying, of course, a slightly different name - Lukas König rather than lukas_könig which I even like better).

+1 vote
by
edited by

Ok, I now solved it in a close-to-satisfactory way by just changing the "nicename" in the user table of the wp database.

It's not a solution as general as I had hoped for, but it seems to work (and fortunately nothing broke down after the change :-) ).

 

EDIT: This didn't solve the problem after all, cf. comment.

by
Ok, this does not really solve the problem as "someone" (i.e. wp or qa) resets the "nicename" every time the user logs in. So it works only for a single session.

Still looking for a good answer... :-)
...