⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

UTF-8, not ISO-8859-1; strange multibyte chars



luciobrigido
  • profile picture
  • Member

Posted 09 April 2012 - 21:04 PM

hi,

I'm a brazilian guy who works with pt-br language and iso-8859-1 is my default charset.

the problem is that with groceryCRUD I'm getting some strange chars and I can see the page is loaded using UTF-8, even if I set my HTML as this:

<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Aerovip Viagens e Turismo</title>
<meta charset="iso-8859-1">
<meta name="description" content="bla lba bla bla">
<meta name="keywords" content="bla bla bla">
<meta name="author" content="my name">
<?php foreach ($css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>">
<?php endforeach; ?>
<?php foreach ($js_files as $file): ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
<style type='text/css'>
body
{
font-family: Arial;
font-size: 14px;
}
a {
color: blue;
text-decoration: none;
font-size: 14px;
}
a:hover
{
text-decoration: underline;
}
</style>
</head>
<body>
<!-- Beginning header -->
<div id="globalnav">
<ul>
<li><?= anchor("admin/inicio", "Início"); ?></li>
</ul>
</div>
<!-- End of header-->
<div id="ajuda">
<?php $this->load->view('admin/ajuda_crud'); ?>
</div>
<div style="height:20px;"></div>
<div>
<?php echo $output; ?>
</div>
<!-- Beginning footer -->
<div>Footer</div>
<!-- End of Footer -->
</body>
</html>


that way I receive some strange chars and my page goes online with UTF-8 as the encoding charset.

This default charset can be configured?

My MySQL table uses latin1, my html says iso8859-1 and my whole system is in Portuguese.

Anyone having same issue? Sugestions?

For now it is not causing me trouble, but it's a bit strange. :-)

----

I'm getting the new version from github now.

And the "ajuda_crud" is a view I created as a "help view", so I can try using if/else to see watch URI the users is using and display some context help.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 09 April 2012 - 21:15 PM

I don't really understand your request. I think if you have the default encoding as utf-8 it will be fine. I have many languages handled (such as greek, japanese, arabic ) and I didn't have any problem with those . So I suggest to change the encoding to utf-8 and everything will work fine for you. So just try this:


<!DOCTYPE html>
<html><!-- There is no need to add lang anymore in html5 :-) -->
<head>
<title>Aerovip Viagens e Turismo</title>
<meta charset="utf-8">
....

luciobrigido
  • profile picture
  • Member

Posted 09 April 2012 - 21:32 PM

hi.

I changed my charset and nothing works.

Now I saw my files are all ANSI encoded. I have to move them to UTF-8 and so It worked.

Now I have to look into my config/config.php and chage my default encoding from iso-8859-1 to UTF-8

thanks cya

rafabiton
  • profile picture
  • Member

Posted 09 August 2012 - 13:26 PM

Hi everyone, I have one doubt similar that.

I have many forms and when the user writes a word with an accent, for example "PÃO", this word is saved in BD without accent, for example, this word is saved as "PO", the grocery crud "cuts" the words with accent.

I have another form without Grocery Crud and this example above and it's ok.

I'm Brazilian and I'm using mysql with charset utf- default collation and my Grocery Crud's version is April last year.

If anyone can help me.

Thank you

Jorge André Martins
  • profile picture
  • Member

Posted 26 August 2012 - 08:23 AM

I am having the same problem. It's actually something about the grocery charset files configuration, as it sticks with UTF-8 even if you change your header to ISO-8859-1. Maybe something with the js files autoladed in the output. Trying to convert everything to ISO-8859-1, will post here if worked.