From: "andrykonchin (Andrew Konchin)" Date: 2022-08-06T11:54:57+00:00 Subject: [ruby-core:109431] [Ruby master Bug#18958] Kernel#sprintf doesn't apply format sequence in some encodings Issue #18958 has been reported by andrykonchin (Andrew Konchin). ---------------------------------------- Bug #18958: Kernel#sprintf doesn't apply format sequence in some encodings https://bugs.ruby-lang.org/issues/18958 * Author: andrykonchin (Andrew Konchin) * Status: Open * Priority: Normal * ruby -v: 3.0.3 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- I've noticed that `sprintf` does nothing (at least for `%f`) when format string is in the following encodings: - UTF-16 - UTF-16BE - UTF-16LE - UTF-32 - UTF-32BE - UTF-32LE - UCS-2BE - UCS-4BE - UCS-4LE - IBM037 - ebcdic-cp-us Example: ```ruby format = "%10.4f".encode("UTF-32") sprintf(format, 12.34) # => "\uFEFF%10.4f" ``` -- https://bugs.ruby-lang.org/ Unsubscribe: