Re: [Cake 1.2. RC1] - Problem with Ajax and encoding

2008-06-15 Thread Spark

database default collation is just a little part, and doesn't matter
as much as you may think.
database connection is far more important (you can change it in
config/database.php), the file you are editing is, i'm almost for
sure, wrongly encoded. Try To change it in Aptana or Eclipse (under
the 'edit' menu, there's a 'set encoding' option. It's the most common
mistake when dealing with utf8. Another sensitive part is the *server*
configurations for sending text/html. Some of very old or badly
configured servers lack the possibility to send it in utf8, therefore,
breaking the path between cake and the browser.

This is *the* article to read. It helped me a thousand times when
dealing with 'i dont need to know this' programmers:
http://www.joelonsoftware.com/articles/Unicode.html

Spark

On Sun, Jun 15, 2008 at 6:33 AM, Webrickco <[EMAIL PROTECTED]> wrote:
>
> Hi, I have a problem figuring out why the result of an Ajax execution
> is not in the correct encoding under cake.
>
> You can see the result at http://webrickco.com/caketest. Using the
> user/password david/test and clicking on the first link: "Alterar a
> configuração dos menus". At this point the result of the consultation
> to the database is correctly displayed as well as all other
> accentuated text in the page, but if I click on a tick button (calls
> an Ajax function to copy the values to the edit fields and refreshes
> the item list), the refresh of the DIV is compromised. How do i do to
> keep the correct encoding after I fire an Ajax function?
>
> Some data on the site:
> Default.ctp: $html->charset('ISO-8859-1');
>
> Ajax function triggered as follow:
> echo "".$ajax->submit('tick.png', array('update' => 'tabela',
> 'loaded' => Effect.BlindDown(\'tabela\')', 'url' => '/menus/update/'.
> $menu['Menu']['id']."/".$menu['Menu']['description']."/".$menu['Menu']
> ['link']))."";
>
> Database fields and tables are kept in utf8_general_ci encoding by
> default
>
> Thx for your help.
>
> >
>



-- 
[livesets] http://djspark.com.br/
[web] http://sydi.net
[filmes] http://melhoresfilmes.com.br

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake 1.2. RC1 - Problem with Ajax and encoding

2008-06-15 Thread AD7six



On Jun 15, 12:13 pm, Webrickco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a test page made with cake 1.2 RC1 and everything is fine
> despite the lack of documentation on the matter.

book.cakephp.org

> I have however a
> little problem on my production site that doesn't happen on local. The
> problem is with encoding. Everything looks fine until i fire an event
> calling Ajax and returning a result refreshing a DIV. At that point,
> the DIV gets a bad encoding. Why is that?

No double posting please.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---