Project

General

Profile

Actions

Bug #18958

closed

Kernel#sprintf doesn't apply format sequence in some encodings

Added by andrykonchin (Andrew Konchin) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:109431]

Description

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:

format = "%10.4f".encode("UTF-32")
sprintf(format, 12.34)
# => "\uFEFF%10.4f"

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0