Some math characters in AJAX string don't display

0 favourites
  • 2 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • Link to .capx file (required!):

    docs.google.com/file/d/0B3KBnviLHFtndDZJazZxWk9NbWc/edit

    Steps to reproduce:

    1. Use AJAX to request a string (via PHP) that includes a division sign (�)

    2. Display that string inside the program

    3. Get angry at seeing a little black diamond with a question mark instead

    Observed result:

    Characters will display correctly.

    Expected result:

    A small black diamond with a question mark appears instead of the affected symbol.

    I've done a decent amount of debugging. My PHP file DOES correctly get the character (from the database, but irrelevant really). If I simply go to the URL of the PHP file, there are no errors. The problem happens within Construct 2. Maybe it's some super obvious charset kind of thing that I don't know about, but I'm getting pretty sad.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 8

    Construct 2 version:

    120.2

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Closing as not a Construct 2 bug; your server appears to be configured incorrectly. I checked the server headers for biosphereenterprises.com/getdivision.php, and it sends the header "Content-Type: text/html". According to here if you don't specify a charset you either get ISO-8859-1, which is a character set that does not include a divide symbol, or the browser will take a wild guess. My guess is you're actually using UTF-8, in which case you absolutely must specify this using the "Content-Type: text/html; charset=utf-8" header. Otherwise you shouldn't expect anything to get transmitted correctly.

    Character encodings can be a bit complicated, but if you 1) use UTF-8 everywhere, and 2) make sure all settings and transmission explicitly says it's UTF-8, then you shouldn't have any problems.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)