Page 1 of 1

french accents

PostPosted: 05 May 2014 15:19
by assapan
Hi,
I have a problem with the french accents with labelex .
If i write directly in the Textex property the html string the characters are displayed correctly but if i do use the loadSourceOptions property to load the same informations contained in an html file the accent are not well displayed !
can you help .
on left side of the attached image is the labelex with html file and on the right side using the textex property.

Re: french accents

PostPosted: 05 May 2014 15:45
by Jorge Sousa
Hello

What is the charset of that html ?

as it is, it must be utf-8

We can however add the property AjaxOptions, to be able to setup the ajax configuration:

namely AjaxOptions.ContentType

contentType (default: 'application/x-www-form-urlencoded; charset=UTF-8')
from
https://api.jquery.com/jQuery.ajax/

Re: french accents

PostPosted: 05 May 2014 18:35
by assapan
Hi ,
I haven't been able to make it work , despite i wrote a procedure , the server get the html file with idhttp and put the result in the labelex and it works :?

Re: french accents

PostPosted: 05 May 2014 18:52
by Jorge Sousa
Hello

That takes twice the time.

can you send us the html by email or post here?

tia

Re: french accents

PostPosted: 06 May 2014 08:45
by assapan
Hi,
attached zipped html

thank you for all

Re: french accents

PostPosted: 06 May 2014 11:22
by Alexander Bulei
Hi assapan,

The problem is in encoding of file.

You need change/convert the Gafor.html to UTF-8.

Use the notepad++ to convert it.

Attached the converted file.

Best Regards.

Re: french accents

PostPosted: 06 May 2014 11:44
by assapan
Hi , it is ok if we are the source of this page but for example if i want to show a page coming from a blog or anything like this i can't unless it is encoded in UTF-8 :?

Re: french accents

PostPosted: 06 May 2014 12:37
by Alexander Bulei
Hi assapan,

Well,
1st- to display that chars, the html page should be in UTF-8 or iso-8859-1 (or another specific charset)
2nd - to get the external page you should configure AjaxOptions:

* Fixed minor issue at next build with ContentTypeString property

delphi code
ContentTypeString:= 'Content-type: text/plain; charset=iso-8859-1'; // or UTF-8
OnBeforeSend.Script:= 'function (jqXHR, settings){ jqXHR.overrideMimeType(''text/html;charset=iso-8859-1'''); }' // or UTF-8;


With your file (ANSI) works as expected.

Best Regards.

Re: french accents

PostPosted: 06 May 2014 14:43
by assapan
Thanks a lot , i tried and it works well .