Skip to content

Time being returned as ASCII-8BIT encoding in JRuby 10 #9307

@AriaXLi

Description

@AriaXLi

Environment Information

$ uname -a
Darwin AMER-Aria-Li 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:06:57 PDT 2024; root:xnu-11215.41.3~3/RELEASE_ARM64_T6041 arm64

Expected Behavior

I would expect Time to return as UTF-8 or US-ASCII like how JRuby 9 and MRI Ruby 3.4 do.

JRuby 9.4

$ jruby -v
jruby 9.4.12.0 (3.1.4) 2025-02-11 f4ab75096a Java HotSpot(TM) 64-Bit Server VM 25.0.2+10-LTS-69 on 25.0.2+10-LTS-69 +jit [arm64-darwin]
$ ruby -rtime -e 'puts Time.now.iso8601.encoding'
UTF-8

MRI Ruby 3.4

$ ruby -v
ruby 3.4.9 (2026-03-11 revision 76cca827ab) +PRISM [arm64-darwin24]
$ ruby -rtime -e 'puts Time.now.iso8601.encoding'
US-ASCII

Actual Behavior

JRuby 10 returns Time as ASCII-8BIT

$ jruby -v
jruby 10.0.3.0 (3.4.5) 2026-02-02 b0be2ab713 Java HotSpot(TM) 64-Bit Server VM 25.0.2+10-LTS-69 on 25.0.2+10-LTS-69 +indy +jit [arm64-darwin]
$ ruby -e 'puts Time.now.iso8601.encoding'
ASCII-8BIT

I believe this behavior may be an unintended side effect of the native Time#xmlschema (iso8601) added in JRuby 10.0.1.0 (see PR here).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions