HaxeFoundation / HaxeFoundation/haxe

[PHP] String literals keys encoding special chars in structures

Open
#12,119 1 comment 0 reactions 0 assignees View on GitHub
platform-php
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Hej,

Idk if it's really an issue or a php config to set, feel free to reject this.
This piece of code :
```haxe
var o = {
"Succès" : true
}
trace( o );
trace( haxe.Json.stringify( o ) );
```
Gives the same result on all plateforms tested : Eval, Neko, HL, JS :
```
{Succès : true}
{"Succès":true}
```
But on PHP it gives that :
```
{ Succ958s : true }
{"Succ\u000195\u000e8s":true}
```
I try to insert that into MySQL and it fails... So it's not really a "Succès" 🙃

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Haxe structure and JSON examples on the PHP target, then compare the generated PHP and output with Eval, Neko, HL, and JS. Done means the accented key remains "Succès" in the PHP result and JSON output, without the encoded corruption shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.