Welcome Guest, Not a member yet? Register   Sign In
UTF-8
#11

[eluser]Tanax[/eluser]
[quote author="Mackstar" date="1238087713"]My Advice when working in another language is to go completely UTF-8,

rebuild your mysql tables with the collation utf8_general_ci and all fields to be so also.. The you just add the lines to your db config and it should get the data out of the database correctly.

$db[‘default’][‘char_set’] = “utf8”;
$db[‘default’][‘dbcollat’] = “utf8_general_ci”;

But in your case you dont know if it is the database data or the page parsing that is wrong.

If you have <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> in your html it is being set somewhere in your CI app, check your headers/footers, or search for ISO-8859-1 in your app to find the culprit.

You could try to juggle the char encoding selection in your browser and see if you get the hoped for output, in which case the meta tag may well be your culprit.


If you did want to play with your db connection you could try

$db[‘default’][‘char_set’] = “latin1”;
$db[‘default’][‘dbcollat’] = “latin1_swedish_ci”;

I do a lot of development in Japanese and have found a strict utf-8 only environment has made things much easier.

Best of luck[/quote]

Code:
$db ['default'] ['char_set'] = "latin1";
$db ['default'] ['dbcollat'] = "latin1_swedish_ci";

Worked great for me!
Not sure if UTF-8 would be better. This works, so I'm happy!

Thanks for the help! And also for the info!


Messages In This Thread
UTF-8 - by El Forum - 03-25-2009, 01:48 PM
UTF-8 - by El Forum - 03-25-2009, 01:59 PM
UTF-8 - by El Forum - 03-25-2009, 02:08 PM
UTF-8 - by El Forum - 03-25-2009, 07:12 PM
UTF-8 - by El Forum - 03-25-2009, 07:18 PM
UTF-8 - by El Forum - 03-25-2009, 08:50 PM
UTF-8 - by El Forum - 03-25-2009, 08:55 PM
UTF-8 - by El Forum - 03-26-2009, 06:02 AM
UTF-8 - by El Forum - 03-26-2009, 06:15 AM
UTF-8 - by El Forum - 03-26-2009, 06:41 AM
UTF-8 - by El Forum - 03-26-2009, 12:57 PM
UTF-8 - by El Forum - 03-26-2009, 05:12 PM
UTF-8 - by El Forum - 11-28-2009, 09:29 AM
UTF-8 - by El Forum - 11-28-2009, 05:04 PM
UTF-8 - by El Forum - 11-29-2009, 03:35 AM
UTF-8 - by El Forum - 11-29-2009, 04:39 AM
UTF-8 - by El Forum - 11-29-2009, 05:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB