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

WordPress Trac noreply at wordpress.org
Wed Aug 13 14:36:55 UTC 2025


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

Comment (by dmsnell):

 That’s a good point @SergeyBiryukov — it was not discussed elsewhere. I
 can add those tests back. On the other hand, is there much value in them
 still? I would hope we aren’t going to propose changing behavior of
 deprecated functions, but I can be convinced.

 One of the reasons that probably motivated me to remove the tests are that
 they just aren’t providing much value at all. The tests claim to make
 behavioral assertions for UTF-8 and non-UTF-8 strings, but in reality they
 check two somewhat arbitrary strings which provide extremely limited
 coverage over the claims. These are mostly “this works in this one
 particular test case but provides very little confidence that it does the
 job in any others” — this is evidenced too by the fact that there’s no
 //invalid// UTF-8 data passed in to the tests and no `latin1` data, no
 `Windows-1252` data, which form a large fraction of the actual encoding
 issues in practice.

 In other words, the tests are written in such a way that plenty of bugs
 can be added to the function without breaking the tests, and the actual
 intended behaviors remain unclear, so the tests aren’t clearly asserting
 anything in particular. I think we can hold the discussion that leaving
 them in place leaves more maintenance burden than we find in actual value
 they provide.

 I’m of the mind that these tests are //mostly// useless weight, but if you
 see them providing value I’m missing I would like to hear it. Also, if
 there is general agreement to leave them in I don’t care that much and
 will add them back. Generally though I do want tests to justify themselves
 in the value they provide.

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


More information about the wp-trac mailing list