Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi for PHP/Demos    [ Add a report in this area ]  
Report #:  118087   Status: Closed
HTML5 Builder basicAjax Demo doesn't work with special characters
Project:  HTML5 Builder Build #:  5.1.167.137
Version:    5.0 Submitted By:   Paco Ruiz
Report Type:  Feature Specification issue Date Reported:  8/22/2013 4:39:31 AM
Severity:    Extreme corner case Last Updated: 8/24/2013 6:35:12 AM
Platform:    All platforms Internal Tracking #:  
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
About Demos\Ajax\Basic\BasicAjax.h5bprj
By default Western European (ISO); ANSI in php files.

If I write a special character like ? (Ñ) or ?(&aacute)
- in the caption button (for example "Click ? a"),
- or in the caption label,
- or in the php response,
the generated html web page hangs up when you click.
In the basicajax.xml.php file I read
<property name="Caption"><![CDATA[Clic &Ntilde; &aacute;]]></property>
that I think it is correct.


If I set basicajax.php file to UTF-8,
I get unreadable characters when the web page is generated.
In the basicajax.xml.php file I read now
<property name="Caption"><![CDATA[Clic ????]]></property>

Although, If I clicl now, ajax works fine and the characters turn into readable for me.
Characters are unreadable until I click.

So, in this second case:
ajax seems to work fine
BUT the html generated shows unreadable characters for me instead my special characters.
Steps to Reproduce:
None
Workarounds
I have found a bad/incomplete workaround.

Second case.
On the PageJSLoad, I do an ajaxCall to a void funcion.
echo $this->Button1->ajaxCall('Button2Click');
Function Button2Click contents nothing.

Now, when I generate the html I get unreadable characters during 1 second !!
and afterthat label and button captions change to readable characters.
Attachment
SampleProject.zip
Comments

Tomohiro Takahashi at 8/22/2013 7:50:36 PM -
> By default Western European (ISO); ANSI in php files.
Even if you set Web page and PHP engine to UTF-8 mode, does your issue still occur?

Paco Ruiz at 8/23/2013 12:54:08 AM -
Yes, in both cases after running the application I get this line in basicajax.xml.php file:
<property name="Caption"><![CDATA[Clic Ñ á]]></property>
that contains unreadable characters and is what I get in the navegator.

I think the correct characters should be:
<![CDATA[Clic Ñ á]]>
or maybe
<![CDATA[Clic &Ntilde; &aacute;]]>

Tomohiro Takahashi at 8/23/2013 1:09:17 AM -
Did you enter the special characters via ObjectInspector?
If yes, unfortunately, ObjectInspector of HTML5 Builder does not fully support Unicode...
For example, when I enter Chinese characters on Japanese environment , the characters will be broken in .xml.php file...

So, please try to set the Caption property at runtime?

Paco Ruiz at 8/23/2013 1:27:31 AM -
Same problem if I try

    function IndexPageCreate($sender, $params)
    {
        $this->Button1->Caption='Click Ñ á';
    }


Tomohiro Takahashi at 8/23/2013 8:47:12 AM -
Is the .php file saved with UTF-8?

and, could you please attach the sample project(with some screenshots) to reprodce/confirm your Unicode character issue?

Paco Ruiz at 8/23/2013 9:42:11 AM -
I close HTML5 Builder.
I open it again. I open .php file,
file format is in UTF8.

Project and screenshots updloaded.
Just run to see the error.

Tomohiro Takahashi at 8/24/2013 6:36:08 AM -
I opened your project and set Encoding property of the Page to UTF-8 via ObjectInpector, then run it with PHP which is configured for UTF-8. But, it works fine.
I re-attached your original project(including my screenshots). Please download and see my results in the 'Tomohiro' subfolder.

I guess PHP settings for UTF-8 mode is not configured properly in your environment.

Paco Ruiz at 8/25/2013 4:18:01 AM -
I've change the default php settings like you and now all works fine.
Special characters via ObjecInspector works fine too.
Thanks a lot

Server Response from: ETNACODE01