[wp-trac] [WordPress Trac] #63974: .mo file loaded as UTF-8 by default - non-standard and ignoring Content-Type headers

WordPress Trac noreply at wordpress.org
Mon Sep 15 14:06:02 UTC 2025


#63974: .mo file loaded as UTF-8 by default - non-standard and ignoring Content-
Type headers
-------------------------------+------------------------------
 Reporter:  kkmuffme           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  I18N               |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by swissspidy):

 * keywords:   => reporter-feedback


Comment:

 @dmsnell It's not about HTTP headers, it's about the `Content-Type` header
 line in `.mo` translation files.

 @kkmuffme This sounds all a bit theoretical to me. Can you help me clarify
 a few things:

 - Is the behavior the same for `WP_Translation_File_MO` and the "old" `MO`
 class? I assume yes, because I don't see any UTF-8 references in that
 code.

 - "some multilingual plugins will save translatable strings" -> are any of
 them saving files not as UTF-8?

 - "leads to non-interoperable .mo files being silently accepted" -> what's
 the downside of being a bit less strict?

 If your suggestion is to reject any MO files with `Content-Type` other
 than UTF-8, then I'd classify this ticket as an enhancement.

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


More information about the wp-trac mailing list