Welcome Guest, Not a member yet? Register   Sign In
How to encode language file in Latin-1???
#1

[eluser]mikegioia[/eluser]
Hi guys -

I'm having the following problem. In my language file, I have the following line:

Code:
$lang['language_spanish'] = "Español";

And in my view I output the line like this:

Code:
echo $this->lang->line('language_spanish');

The problem is that the accented 'ñ' in 'Español' comes out an ugly 'Espa�ol'. I've tried passing it through htmlentities with the character encoding set to UTF-8 but I checked around and it seems all the language files created by other users here encode their foreign language files in Latin-1. Is there any way to do this?

I'll be having a Spanish translation soon and it'll more than likely be typed up in UTF-8 like the above example. How can I prevent against all of those question marks in the output without having to pass every $this->lang->line() statement through some output handler?

Thanks for any help,
Mike
#2

[eluser]helmutbjorg[/eluser]
I'm having the exact same problem. Did you find a solution?
#3

[eluser]GSV Sleeper Service[/eluser]
have you added a content type meta tag to your html?
eg
Code:
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
#4

[eluser]helmutbjorg[/eluser]
This is copied from the source of the page

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

Also from config.php

Code:
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = "UTF-8";

Code should read
Code:
No valido usario/contraseña

But i get
Code:
No valido usario/contraseña

and php files are saved in utf-8

I'm stumped.
#5

[eluser]RJ[/eluser]
Any solutions found?

This works but definitely not ideal!

Code:
$phone = htmlentities($this->lang->line('mobile'));
echo $phone;
#6

[eluser]TheFuzzy0ne[/eluser]
What doctype are you using?
#7

[eluser]RJ[/eluser]
Was switching from UTF to iso for some reason; went to all UTF8 and works fine.




Theme © iAndrew 2016 - Forum software by © MyBB