Codeigniter unable to fetch Thai data - codeigniter

I am developing a website which supports Thai language. Now i have the Thai data in my database which is proper, but when am trying to fetch the data and display in my view, some junk content is being displayed like this À¹À¸ŸÀ¸¥À¸ŠÀ¹„À¸”À¸£À¹ŒÀ¸Ÿ À¸„À¸´À¸‡À¸ªÀ¹ŒÀ¸•À¸±À¹‰À¸
The content is displayed properly when i write a core PHP script and echo it.
In my db i have used collation : utf8_general_ci
In codeigniter's application/config/database.php i have the following configuration.
$db['livedb']['char_set'] = 'utf8';
$db['livedb']['dbcollat'] = 'utf8_general_ci';
And in the header view am using <meta charset="utf-8" />
Please help me where am i going wrong. Thanks for help in advance.

You should use utf-8 meta in your view
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Have you got the meta tag for displaying UTF8 in your head tag
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Related

Jsreport rendering russian language

When I render jsreport pdf using phantom and html-to-pdf with character from russian, they become weird symbols. Is there any settings in jsreport or I need correct font in the server machine?
http://jsreport.net/learn/phantom-pdf
Phantom-pdf is currently not able to print some national characters by
default. To be able to print correct national characters into pdf you
need to set utf-8 charset in your html first.
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
Česko
</body>
</html>

How to get my site using UTF-8 (PHP site)

First time poster and hoping to solve a very frustrating issue.
In Google chrome, my PHP site displays random characters such as Â. However, when I switch the encoding to UTF-8 all the random characters clear up.
I've been reading elsewhere that that I need to tell me site to use UTF-8 by default. My host say this is already enabled on their side.
What code do I add and where to solve this issue?
Put:
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
In the <head> of the document, and it should force the page to render utf-8 characters properly.
Further description: In your HTML page, you would have the page layed out as such:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
<!--<link> tags for any CSS-->
<!--<script> tags for any JS-->
<!--Anything else in the head-->
</head>
<body>
<!--Page contents-->
</body>
</html>

Google Chrome cache buggery : Chrome does not fetch latest version of the page despite NO-CACHE

I want to know how to instruct Chrome not to use a cached version of a page. I cannot get Google Chrome [15.0.874.106 m] to load the latest version. There was a typo on the page and I've corrected it. Other browsers fetch the corrected page. Chrome, not. Here below is what I have in the header section; should I add anything or change something? Also, the browser is not set up "Under the Hood" to use any sort of DNS-prefetching. Just to be clear, I don't want to clear the cache manually, but want to know how to manipulate Chrome's page-caching policies in a declarative manner. Thanks
P.S. I had this problem once before (see this question) but the circumstances are somewhat different this time, so I don't know what's going on. This page too is being displayed in a frame, but it had a no-cache policy from the get-go.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML LANG="en-US">
<HEAD>
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Wed, 26 May 2010 00:00:11 GMT">
<META NAME="ROBOTS" CONTENT="NOARCHIVE">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
.
.
.
</HEAD>

Problem with encoding

i have written my HTML code with the meta datas of
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
meta http-equiv="Content-Type" content="text/html; charset=utf-8"
meta http-equiv="cache-control" content="NO-CACHE"
meta http-equiv="content-language" content="pt"
it is in UTF-8 format but when i opened this page in IE6 browser the encoding type is western european(ISO) so it shows portuguese language as informação originaly the string is informação
what could be the problem
please guide me
The problem is IE6. Ask any web developer.
Anyway, you'd better concentrate on newer browser versions, there's no use wasting your time with IE6 because you won't learn anything other than that it implements its own standards, which is absolutely not useful.

HTML5: What is the "correct" behavior for validation of unregistered <meta> tags?

The following is valid 'HTML 4.01 Transitional' according to the W3 validator:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="revisit-after" content="30 days">
<meta name="DC.Title" content="Website title">
<title>Website title</title>
</head><body></body></html>
When transforming this code to HTML5, the meta-tag underwent some changes as documented here. Thus, the following should be valid HTML5:
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<meta name="revisit-after" content="30 days">
<meta name="DC.Title" content="Website title">
<title>Website title</title>
</head><body></body></html>
Except that it doesn't validate as apparently meta tags are supposed to be registered now.
Problem: The W3 documentation does not list restrictions on meta-tags as a new "feature" of HTML5, but they do not validate like they did previously in HTML 4.01 Transitional.
Update: While the official HTML4 documentation does indeed not restrict the field values of the name attribute, the HTML5 draft mentions the new restriction (unlike the "differences" guide). Some posters suggest to not use meta-tags at all based on SEO arguments, but there have been many public and internal uses of meta-tags for cache control, documentation and storage purposes. Should there not be a way to turn valid HTML4 code into valid HTML5 code without relying on millions of meta-parsers to rewrite themselves automagically?
Question: What should we do in practice?
In practice, just leave the meta tags as they are. Even if the validator complains, it doesn't make a single bit of difference to anyone using your website.

Resources