Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[php] haxe.io.Bytes.getString issues #8212

Closed
Aurel300 opened this issue Apr 24, 2019 · 1 comment
Closed

[php] haxe.io.Bytes.getString issues #8212

Aurel300 opened this issue Apr 24, 2019 · 1 comment
Assignees
Labels
platform-php Everything related to PHP unicode
Milestone

Comments

@Aurel300
Copy link
Member

class Main {
  static var validBytes = haxe.io.Bytes.ofHex(
    "010A" +
    "7F0A" +
    "C2800A" +
    "DFBF0A" +
    "E0A0800A" +
    "ED9FBF0A" +
    "EE80800A" +
    "EFBFBD0A" +
    "F09F9882F09F9884F09F98990A" +
    "C8A70A"
  );
  
  static function main():Void {
    Sys.println(validBytes.getString(0, validBytes.length, UTF8));
  }
}
$ haxe --main Main --php out
$ php7.2 out/index.php | xxd
0000000: 010a 7f0a c280 0adf bf0a e0a0 800a ed9f  ................
0000010: bf0a ee80 800a 0a                        .......

This also works with shorter strings; it's not that a particular codepoint causes it to stop parsing. I think the problem is that the string length is incorrect if there are any non-BMP sequences.

@Aurel300 Aurel300 added platform-php Everything related to PHP unicode labels Apr 24, 2019
@RealyUniqueName RealyUniqueName self-assigned this Apr 24, 2019
@RealyUniqueName RealyUniqueName added this to the Release 4.0 milestone Apr 24, 2019
@Aurel300
Copy link
Member Author

Aurel300 commented Apr 24, 2019

I think your commit broke the CI. https://travis-ci.org/HaxeFoundation/haxe/jobs/524202748

@Aurel300 Aurel300 reopened this Apr 24, 2019
Aurel300 added a commit that referenced this issue Apr 24, 2019
back2dos pushed a commit to back2dos/haxe that referenced this issue Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-php Everything related to PHP unicode
Projects
None yet
Development

No branches or pull requests

2 participants