Arabic Text Display Issue

Hi All,

I am new to Yii application development, i ran into the issue of the arabic text display issue. I am getting all the text from database and i have tried to display it using the following code,


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/DTD/xhtml1-transitional.dtd">

<html xmlns="removed the link because its my first post:P" xml:lang="en" lang="en">

<head>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<meta name="language" content="en" />

	<!-- Set the viewport width to device width for mobile -->

  	

	

</head>

<body>

<?php


	$conn = mysqli_connect("localhost","username","password","some database") or die ("connection error : " . mysqli_error());

	

	$result = mysqli_query($conn,"SELECT * FROM my_table WHERE field = 'value'");


	while($row = mysqli_fetch_array($result))

  	{

  		echo $row['title'] . " ::  " . $row['description'];

  		echo "<br>";

  	}


	mysqli_close($conn);

?>

</body>

</html>




Now the above code display arabic as it should be doing, when i try the same approach using Yii application, it shows some weird characters. I have added the character set information in /layout/main.php but no use.

I would love to hear a solution ,

Thanks

Please show the code you tried in Yii

Well the whole view is quite big file, i can’t paste all the code here but let me give you a brief work flow.

  1. Made a controller that fetches information using MyModel::model()->find();

  2. In this->render() method i am sending the information using the variable called $data.

  3. I am using echo to print the information which i get from the controller like

    echo $data->title . " : : " . $data->description;

Now the default website is in english, but i want to show the following text in arabic, as it is by default in arabic. So tell me what can i do approach this.

Are you saying that when [font=“Courier New”]$data->title[/font] contains Arabic text, it doesn’t display correctly in your url?

Or are you speaking about labels, texts, and dialogs of the views?

What is your db and what is your connection config?

Well paste at least your main layout headers… or better, put a test app somewhere where I could debug.

Ah yes, see also this wiki: http://www.yiiframework.com/wiki/16/how-to-set-up-unicode (mdomba has just brought it up in another thread)