facebook / facebook/hhvm

`hh_parse --full-fidelity-json` generates strictly invalid JSON for non-UTF8 sequences

Open
#8,245 0 comments 0 reactions 0 assignees View on GitHub
hack
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version

HHVM 3.27.0

### Operating System and Version

MacOS High Sierra

### Standalone code, or other way to reproduce the problem

```
$ hh_parse --full-fidelity-json hphp/test/quick/Empty.php | hhvm --php -r 'var_dump(json_decode(trim(stream_get_contents(\STDIN))) === NULL);'
$ hh_parse --full-fidelity-json hphp/test/zend/good/ext/iconv/tests/eucjp2sjis.php | hhvm --php -r 'var_dump(json_decode(trim(stream_get_contents(\STDIN))) === NULL);'
```

### Actual result

```
bool(false)
bool(true)
```

### Expected result

```
bool(false)
bool(false)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.