![]() |
|
|
|||||||
| embarcadero.public.delphiphp.non-technical General non-technical issues related to Delphi for PHP. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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. |
| Sponsored Links |
|
|
|
|||
|
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 |
|
|||
|
> {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 |
|
|||
|
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 |
|
||||
|
Maybe this
Dbgrid and Ajax |