Skip to content

Commit

Permalink
Merge pull request #34 from rolandsusans/master
Browse files Browse the repository at this point in the history
Update HighchartOption.php
  • Loading branch information
ghunti committed Aug 12, 2015
2 parents cbaed3b + e276d4f commit 60efed1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/HighchartOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ public function __construct($value = null)
{
if (is_string($value)) {
//Avoid json-encode errors latter on
$this->_value = iconv(
mb_detect_encoding($value),
"UTF-8",
$value
);
if(function_exists('iconv')){
$this->_value = iconv(
mb_detect_encoding($value),
"UTF-8",
$value
);
} else {// fallback for servers that does not have iconv
$this->_value = mb_convert_encoding($value, "UTF-8", mb_detect_encoding($value));
}
} else if (!is_array($value)) {
$this->_value = $value;
} else {
Expand Down

0 comments on commit 60efed1

Please sign in to comment.