views:

107

answers:

1

Hi,

I have unicode characters in MySQL tables. I will print the data in the web pages. While printing it in the pages I am generating the 'Share This' buttons dynamically to share each record in that table (which is in Punjabi).

So the output in the page looks fine. But while sharing the same content in 'Share This' the destination page shows some unknown characters. Later I found that the data sent across the websites should be in Unicode Entity format (like ਆ this will print this '').

Now my tables have the values like ਜ ਝ ਞ ਟ ਠ ਡ ਢ.

I want to convert these data like ਜ ਝ ਞ ਟ ਠ ਡ ਢ in PHP.

Please help me in this.


The above issue fixed. But the Share This is still making issues while displaying the Unicode characters. Below is the output in the browser.

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"&gt;&lt;/script&gt;`
<script type="text/javascript">
stLight.options({
    publisher:'12345'
});
</script>
<span class="st_facebook" st_title="ੴਸਤਿ ਨਾਮੁ ਕਰਤਾ ਪੁਰਖੁ ਨਿਰਭਉ ਨਿਰਵੈਰੁ ਅਕਾਲ ਮੂਰਤਿ ਅਜੂਨੀ ਸੈਭੰ ਗੁਰ ਪ੍ਰਸਾਦਿ ॥" st_url="http://sitelink/"&gt;&lt;/span&gt;

Thanks in advance, Abu Sithik

A: 

You should probably use url_encode the text when outputting the href of your <a> tag.

aularon
Thanks friend. I got this solution from this page `http://www.php.net/manual/en/function.htmlentities.php#96648` using `utf8tohtml($utf8, $encodeTags)` method. But the issue is now the 'Share This' is not sharing the entities itself. :(
Abu Sithik
@Abu You're welcome :) Can you edit your question adding the php code outputting the share button, and the html output (page source in the browser) of it?
aularon
Done. The Gurmukhi (Punjabi) characters showing in the st_title attrib is actually like `ੴਸ`. Not as displayed here.
Abu Sithik