forked from vitalif/fast-json-stream
Compare commits
4 Commits
master
...
unicode-es
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c553b74c89 | ||
| 2e96029789 | |||
| ae3cc7d883 | |||
| 8607a7f516 |
@@ -47,6 +47,10 @@ class JSONStream
|
||||
$this->offset++;
|
||||
$this->skipWhitespace();
|
||||
$st = $this->buffer[$this->offset] === '}' ? 2 : 1;
|
||||
if ($st == 2)
|
||||
{
|
||||
$this->offset++;
|
||||
}
|
||||
$this->in[] = [ $st, self::OBJ, NULL, false ];
|
||||
}
|
||||
|
||||
@@ -64,6 +68,10 @@ class JSONStream
|
||||
$this->offset++;
|
||||
$this->skipWhitespace();
|
||||
$st = $this->buffer[$this->offset] === ']' ? 2 : 1;
|
||||
if ($st == 2)
|
||||
{
|
||||
$this->offset++;
|
||||
}
|
||||
$this->in[] = [ $st, self::ARR, NULL, false ];
|
||||
}
|
||||
|
||||
@@ -119,7 +127,7 @@ class JSONStream
|
||||
$v = $this->readToken();
|
||||
} while (count($this->in) > $n);
|
||||
$value = $v;
|
||||
return ($this->in[count($this->in)-1][0] == 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function unreadBuffer()
|
||||
@@ -224,7 +232,7 @@ class JSONStream
|
||||
$this->offset += strlen($m[0]);
|
||||
if ($m[0][0] == "\\")
|
||||
{
|
||||
if ($m[0] == 'u')
|
||||
if ($m[0][1] == 'u')
|
||||
$v .= mb_convert_encoding(pack('H*', str_replace('\\u', '', $m[0])), 'UTF-8', 'UTF-16BE');
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user