Jump to content

Json strange special characters


ChrisTERiS

Recommended Posts

Hello all,

I've a problem to display Georgian language (UTF-8)  characters using this code:

$ct_agreements = Capsule::table('mod_legalterms_articles')
				->where('language',''.$_SESSION["Language"].'')
				->orderBy('displayorder','asc')
				->get();
}
$encodedata = json_encode($ct_agreements);
$decodedata = json_decode($encodedata, true);
foreach($decodedata as $key => $value)
{
	$title = $decodedata[$key]['title'];
}

This output the block below (the block title is correct), the titles not.

image.png.789a582cd831e0fe9e2b319bcb8f84d4.png

In another place where I'm using normal MySQLi query, so no JSON output, everything works fine.

image.png.da33ae2104c267a908de3d0ce9490dfe.png

Any idea/suggestion is welcome :)

Thank you

Chris

Link to comment
Share on other sites

Finally the problem is with all titles having special characters. eg German, Greek, Cyrillic and most probably Arabic etc.

Does anyone knows what's wrong? The code is from a hook file. For testing purposes I change the query to a normal MySQLi query and everything works fine. So the problem is on the JSON.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated