[wp-trac] [WordPress Trac] #38044: Make seems_utf8() RFC 3629 compliant.

WordPress Trac noreply at wordpress.org
Sat Nov 15 01:59:23 UTC 2025


#38044: Make seems_utf8() RFC 3629 compliant.
--------------------------+----------------------
 Reporter:  gitlost       |       Owner:  dmsnell
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  6.9
Component:  Formatting    |     Version:  1.2.1
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+----------------------

Comment (by dmsnell):

 Remarkably, the original author has responded and shared about the
 founding of `seems_utf8()`. It seems to confirm the conclusion: “should
 this string be converted into UTF-8 or is it already UTF-8?”

  > At the time, I was dealing with ISO-8859-1 and UTF-8 strings, which
 were equally common in websites and data feeds in France in 2004. Some
 files did not contain any encoding information, so I had to figure out
 which one was used in order to potentially call utf8_encode() on the data.

 This and some other comments confirm our resolution, which is to encourage
 people to use `wp_is_valid_utf8()`, and also to move away from this
 paradigm of assuming that something must be `latin1` if it’s not a valid
 UTF-8 string.

 Mystery resolved.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/38044#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list