Opened 13 years ago
Closed 13 years ago
#23495 closed defect (bug) (duplicate)
Special characters can truncate WP Option value
| Reported by: | TobiasBg | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Database | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
I recently experienced something weird when adding a string from a foreign language as the value of a WP Option.
Try this:
add_option( 'weird_character_test', 'test1
Change History (4)
#2
@
13 years ago
- Keywords close added
Thanks for testing.
I've played with this some more, and it seems more of a mySQL thing.
I can confirm it on several different sites, with the easiest way being copying the string
test1
#4
@
13 years ago
- Component General → Database
- Keywords close removed
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
I could reproduce with a PHP script on a second page load. I guess the first one printed a cached value, which might explain comment:1. Also reproduced via wp-admin/options.php.
When trying to insert the suggested value using phpMyAdmin, I get a warning:
Warning: #1366 Incorrect string value: '\xF0\xA0\x86\xA2te...' for column 'option_value' at row 1
So, it's a 4-byte character, and this ticket a duplicate of #13590. #21212 would fix this.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Can't reproduce using trunk; also have "utf8_general_ci".