Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Uncode characters problem in frontend

Uncode characters problem in frontend 6 Jahre 7 Monate her #486

  • cheeseus
  • cheeseuss Avatar
  • OFFLINE
  • Fresh Boarder
  • Beiträge: 6
  • Dank erhalten: 1
  • Karma: 0
Hi,

Let me begin by saying how much I appreciate your component. I have been struggling for many days to find a way to display user profile data on the frontend. Of course, I will need to make some modifications to your code to make it suit my needs but that's implied.

There's a problem, however, that I think you need to address. Perhaps a new addition, but Joomla now encodes Cyrillic text submitted to the database (to the #__user_profiles table) using the json_encode() function.

Unless you use json_decode() on the output, anything written in Cyrillic script (in my case Bulgarian but this also applies to Russian and other non-English languages I guess) will print like this:
"\u0421\u043e\u0444\u0438\u044f"

So, in your code, in /components/com_userprofile/models/userprofile.php, I am adding json_decode() like this:
if($params->get('showCity',1) == 0) {
$html .= '<td>'.json_decode($row->city).'</td>';
}

* This is a new field I have added.

Cheers!
Folgende Benutzer bedankten sich: Jonny132

Uncode characters problem in frontend 6 Jahre 7 Monate her #491

  • Jonny132
  • Jonny132s Avatar
  • OFFLINE
  • Administrator
  • Beiträge: 151
  • Dank erhalten: 3
  • Karma: 4
Hi cheeseus,

thats interesting. I only can refer to german and english, because that are the languages I'm testing in.

Thats why it's very important that there are people like you, which are showing me this problems. So thank you very much. I appriciate your help.

I will put it in my code as soon as possible :)

Thanks again!

Uncode characters problem in frontend 6 Jahre 7 Monate her #493

  • cheeseus
  • cheeseuss Avatar
  • OFFLINE
  • Fresh Boarder
  • Beiträge: 6
  • Dank erhalten: 1
  • Karma: 0
You're welcome!

Glad my feedback helps. Your component has saved me a lot of time :)
Ladezeit der Seite: 0.131 Sekunden