Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Delphi4PHP NNTP Newsgroups > embarcadero.public.delphiphp.non-technical
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

embarcadero.public.delphiphp.non-technical General non-technical issues related to Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28th March 2009, 00:09
Eduardo Salinas
Guest
 
Posts: n/a
Default Problem Ajax

Hello.
A few days ago I bought Delphi for php, and I have several applications, but when I started to use ajax, I have had problems with the "ñ" and the accents, because the shows strange characters. I have searched various forums for solutions, but are not working properly. The version I use is 2.1.0.1083.

Is it possible that I can help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28th March 2009, 05:48
Jonathan Benedicto
Guest
 
Posts: n/a
Default Re: Problem Ajax

Eduardo Salinas wrote:
> Hello.
> A few days ago I bought Delphi for php, and I have several applications,
> but when I started
> to use ajax, I have had problems with the "ñ" and the accents, because the
> shows strange
> characters. I have searched various forums for solutions, but are not
> working properly.
> The version I use is 2.1.0.1083.
>
> Is it possible that I can help.


In the OnBeforeAjaxProcess event, add the following code:

global $ajaxResponse;

$ajaxResponse->setCharEncoding( 'iso-8859-1' );

Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 28th March 2009, 17:44
Eduardo Salinas
Guest
 
Posts: n/a
Default Re: Problem Ajax

> {quote:title=Jonathan Benedicto wrote:}{quote}
> Eduardo Salinas wrote:
> > Hello.
> > A few days ago I bought Delphi for php, and I have several applications,
> > but when I started
> > to use ajax, I have had problems with the "ñ" and the accents, because the
> > shows strange
> > characters. I have searched various forums for solutions, but are not
> > working properly.
> > The version I use is 2.1.0.1083.
> >
> > Is it possible that I can help.

>
> In the OnBeforeAjaxProcess event, add the following code:
>
> global $ajaxResponse;
>
> $ajaxResponse->setCharEncoding( 'iso-8859-1' );
>
> Jon


Jon,
Inserté el código, y el formulario se ve bien, pero los datos contenidos en los edit y memos aparecen con sÃ*mbolos extraños.
Te puedo enviar el formulario para que lo puedas revisar?.

Saludos.
__________________________________________________ _______
Jon,
Enter the code and the form looks good, but the data contained in the memos and edit weird symbols appear.
You can send the form so that you can review?.

Greetings.

ESR
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 28th March 2009, 19:52
Jonathan Benedicto
Guest
 
Posts: n/a
Default Re: Problem Ajax

Eduardo Salinas wrote:
> Jon,
> Enter the code and the form looks good, but the data contained in the
> memos and edit weird symbols appear.
> You can send the form so that you can review?.


Do you mean that the data returned by the edit and memo controls contain
weird characters? This is probably because the browser is returning UTF-8
instead of iso-8859-1. Add this code to the top of the PHP file:

foreach( $_POST as &$value )
$value = utf8_decode( $value );

With that said, the best way to handle extended characters is to use UTF-8.
You'll need to make sure your database tables are using UTF-8, and your page
tells the browser that it contains UTF-8 data. You'll then be able to remove
the call to set the Ajax response encoding.

Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 29th March 2009, 01:13
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,274
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Maybe this
Dbgrid and Ajax
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 03:01.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use