Skip to content

Commit

Permalink
Fix parsing for multibyte strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dqsully committed Feb 10, 2019
1 parent aae79f6 commit 2257b0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HJSON/HJSONParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ private function next($c = false)

// Get the next character. When there are no more characters,
// return the empty string.
$this->ch = (mb_strlen($this->text) > $this->at) ? $this->text[$this->at] : null;
$this->at++;
$this->ch = (strlen($this->text) > $this->at) ? mb_substr(mb_strcut($this->text, $this->at), 0, 1) : null;
$this->at = $this->at + strlen($this->ch);
return $this->ch;
}

Expand Down

0 comments on commit 2257b0d

Please sign in to comment.