0

I am using php code to display Amount from Database And Using Following Code. But In Internet Explorer, Strange characters Are Seen (Please see attached images) Same In Below Region, There is No coding, Till Internet Explorer is showing some strange character.

I have attached 2 images - one from IE And second is from Chrome Browser.

code used to display amount is -

$qty = $row['total_amount'];
setlocale(LC_MONETARY, 'en_IN');
$amount = money_format('%.0n', floor($qty));

And in table showing amount -

<?echo $amount;?>

In Below Part where Blank Space Should Be there, IE is showing strange characters, CODE Is -

<div width="90%" style="border:2px outset #336600; border-radius:10px;  padding:5px;"><b>Alphabetical Doctors List Who Donated For High Court Case</b><br>

And Then pagination php code and following code -

<div><?php   echo Pages("tutorials",$perpage,"index.php?");     ?></div>

What can be reason and Solution ?

Image 1 -(Internet Explorer)

enter image description here

Image 2 - (Chrome)

enter image description here

chplab
  • 49
  • 8

2 Answers2

0

I used following solution for this problem...

Changed code

$qty = $row['total_amount'];
setlocale(LC_MONETARY, 'en_IN');
$amount = money_format('%.0n', floor($qty));

TO

$qty = $row['total_amount'];
setlocale(LC_MONETARY, 'en_IN');
$amount = money_format('%.0n', floor($qty));

$qtyIE = $row['total_amount'];
$amountIE = (floor($qty));

And Made changes in table displaying result

From

<?echo $amount;?>

TO

<? if ( eregi("MSIE", getenv( "HTTP_USER_AGENT" ) ) || eregi("Internet Explorer", getenv("HTTP_USER_AGENT" ) ) ) {
?>
Rs. <?echo $amountIE;?>

<?}else{

echo $amount; }?>

So Instead Of Showing Strange Characters, Now It Is Showing Rs.

I don't know, Is it right solution or not...But I did it..

chplab
  • 49
  • 8
0

There are two distinct issues here:

1) The page uses UTF-8 encoding but does not declare it properly. From the comments, it seems that in this case, adding <meta charset=utf-8> is sufficient. Regarding the issue more generally (in PHP context), see UTF-8 all the way through

2) The INDIAN RUPEE SIGN is relatively new in Unicode. It is included in newest versions of several fonts and in some special fonts. Web browsers might be unable to render it even if the system contains some fonts that have a glyph for it; they may need help from the author as a a font-family setting. There are existing questions on this at SO, e.g. Indian rupee symbol, though the current answers might be somewhat outdated or too abstract.

Community
  • 1
  • 1
Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390