[wp-trac] [WordPress Trac] #18007: is_serialized trouble for multibytes encoding
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 28 15:31:43 UTC 2012
#18007: is_serialized trouble for multibytes encoding
----------------------------------------+------------------------------
Reporter: challet | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Charset | Version: 3.2
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests |
----------------------------------------+------------------------------
Comment (by challet):
Replying to [comment:5 kurtpayne]:
> I am doing the following:
>
> * `ALTER TABLE wp_options MODIFY option_value LONGTEXT CHARACTER SET
utf8 COLLATE utf8_unicode_ci;`
> * `INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`)
VALUES ('test_18007_option', 'a:0:{}', 'yes');`
> * `get_option( 'test_18007_option' );`
>
> This returns the correct value ... an empty array.
You should try something like :
{{{
`INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`)
VALUES ('test_18007_option', 'a:0:{"text": "aéùp"}', 'yes');`
}}}
The shift between the length (in bytes) and the length (in charcters
number) happens when there is indeed a character using multiple bytes.
> This is a little tricky
It is :)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18007#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list