Getting strange text results back such as \u25cf
Moderator: General Moderators
Re: Getting strange text results back such as \u25cf
That works for me without a hitch as well.
Re: Getting strange text results back such as \u25cf
Don't know what to say. I'm surprised. Is this a config issue? Something I need to change in php.ini?
Re: Getting strange text results back such as \u25cf
json extension has no configuration settings. What does 'php --re json' return?
Re: Getting strange text results back such as \u25cf
Code: Select all
Extension [ <persistent> extension #32 json version 1.2.1 ] {
- Constants [12] {
Constant [ integer JSON_HEX_TAG ] { 1 }
Constant [ integer JSON_HEX_AMP ] { 2 }
Constant [ integer JSON_HEX_APOS ] { 4 }
Constant [ integer JSON_HEX_QUOT ] { 8 }
Constant [ integer JSON_FORCE_OBJECT ] { 16 }
Constant [ integer JSON_NUMERIC_CHECK ] { 32 }
Constant [ integer JSON_ERROR_NONE ] { 0 }
Constant [ integer JSON_ERROR_DEPTH ] { 1 }
Constant [ integer JSON_ERROR_STATE_MISMATCH ] { 2 }
Constant [ integer JSON_ERROR_CTRL_CHAR ] { 3 }
Constant [ integer JSON_ERROR_SYNTAX ] { 4 }
Constant [ integer JSON_ERROR_UTF8 ] { 5 }
}
- Functions {
Function [ <internal:json> function json_encode ] {
- Parameters [2] {
Parameter #0 [ <required> $value ]
Parameter #1 [ <optional> $options ]
}
}
Function [ <internal:json> function json_decode ] {
- Parameters [3] {
Parameter #0 [ <required> $json ]
Parameter #1 [ <optional> $assoc ]
Parameter #2 [ <optional> $depth ]
}
}
Function [ <internal:json> function json_last_error ] {
- Parameters [0] {
}
}
}
}
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Getting strange text results back such as \u25cf
Are you using Linux, Mac or Windows? If Linux, what shell? Don't know if it matters, but I just tried it on Windows and I got odd characters, just not the ones you got.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Getting strange text results back such as \u25cf
I had a try as well. Didn't get the characters you are getting but I did get odd characters like AbraCadaver (command line on windows). Tried a bunch of options with stream_context_create() but couldn't figure it out!
This one is intriguing.
This one is intriguing.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Getting strange text results back such as \u25cf
It is worth noting that if you recurse through the array after decode, all array elements are ASCII except the $data['results'][0]['description'] which is UTF-8. That is most likely the problem that your OS or shell is not handling the UTF-8 encoding.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Getting strange text results back such as \u25cf
Using linux, centos specifically.
Any idea how to fix the UTF-8 encoding problem?
This just seems really odd to me.
Any idea how to fix the UTF-8 encoding problem?
This just seems really odd to me.