[wp-trac] [WordPress Trac] #27333: update_option() truncates the option value
WordPress Trac
noreply at wordpress.org
Sun Mar 9 16:48:42 UTC 2014
#27333: update_option() truncates the option value
--------------------------+----------------------
Reporter: bmthemes | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Database | Version: 3.8.1
Severity: normal | Resolution: invalid
Keywords: | Focuses:
--------------------------+----------------------
Changes (by SergeyBiryukov):
* component: General => Database
Comment:
The character here is a 2-byte
[http://www.fileformat.info/info/unicode/char/ba/index.htm masculine
ordinal indicator], so #13590 and #21212 appear to be irrelevant.
I could not reproduce the issue. My steps:
1. Save these lines to a file encoded in UTF-8 and run it:
{{{
include 'wp-load.php';
add_option( 'test', 'testºthis' );
// echo get_option( 'test' );
// delete_option( 'test' );
}}}
2. Comment out `add_option()` and uncomment `get_option()` (to make sure
the result comes from the database and not from cache).
3. The result is `testºthis`.
4. Uncomment `delete_option()` to delete the option.
If the string comes from a file in your case, make sure it's encoded in
UTF-8. If that doesn't help, try inserting the same string with phpMyAdmin
to see if the database charset is correct.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27333#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list