我想使用Codeigniter框架在网页中使用urdu吗? [英] I want to use urdu in webpage using codeigniter framework?

查看:121
本文介绍了我想使用Codeigniter框架在网页中使用urdu吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在在Codeigniter框架中使用urdu开发一个网站.我要加载 乌尔都语在我的网页上,但我每次都失败了. 当我尝试访问urdu数据并将其显示在网页中时,我以uni代码将urdu发送到数据库中,并显示了附件中的其他内容.

I am developing a website using urdu in codeigniter framework. I want to load urdu in my webpages but I failed every time. I send urdu to database in uni code when I am trying to access urdu data and show it in webpage it show me some other things which is in attachment.

我已经在下面使用了元标记

I already used meta tag below

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

如何使用codeigniter框架在网页中编写urdu.

How can I write urdu in webpage using codeigniter framework.

推荐答案

步骤:1-转到表结构并将排序规则 latin1_swedish_ci 更改为 utf8_general_ci

Step : 1 - Go to table structure and change collation latin1_swedish_ci to utf8_general_ci

步骤2:-您必须在数据结果页面中包含以下标记.

Step : 2 - You have to include this following tag in data results pages.

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

步骤:3-插入"N"前缀.这里的N代表本国语言字符集.这意味着您正在传递NCHAR,NVARCHAR或NTEXT值

Step :3 - Insert 'N' Prefix. Here the N stands for National language character set. Which means that you are passing an NCHAR, NVARCHAR or NTEXT value

步骤:4-PHP代码显示记录表单数据库.在此之前,您必须指定mysql_query()函数数据字符集类型

Step :4 - PHP code displaying records form database. Before that you have to specify mysql_query() function data character set type

<?php
include('db.php');
mysql_query ("set character_set_results='utf8'"); 
$query = mysql_query("SELECT * FROM books") or die(mysql_error());
while($row=mysql_fetch_array($query))
{
echo $row['id']; // Book id 
echo $row['books_title']; // Book title
}
?>

这篇关于我想使用Codeigniter框架在网页中使用urdu吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆