Skip to content

Commit 406d423

Browse files
committed
Allow Time#strftime to be called with binary format strings.
1 parent 004d184 commit 406d423

File tree

3 files changed

+4
-37
lines changed

3 files changed

+4
-37
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Bug fixes:
44

55
* Fixed `Symbol#match` returning `MatchData` (#1706).
6+
* Allow `Time#strftime` to be called with binary format strings.
67

78
Compatibility:
89

src/main/java/org/truffleruby/core/time/RubyDateFormatter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.jcodings.Encoding;
4646
import org.jcodings.specific.ASCIIEncoding;
4747
import org.truffleruby.RubyContext;
48-
import org.truffleruby.core.encoding.EncodingManager;
4948
import org.truffleruby.core.rope.Rope;
5049
import org.truffleruby.core.rope.RopeBuilder;
5150
import org.truffleruby.core.rope.RopeOperations;
@@ -522,7 +521,7 @@ public static RopeBuilder formatToRopeBuilder(List<Token> compiledPattern, Zoned
522521
// reset formatter
523522
formatter = RubyTimeOutputFormatter.DEFAULT_FORMATTER;
524523

525-
toAppendTo.append(output.getBytes(EncodingManager.charsetForEncoding(toAppendTo.getEncoding())));
524+
toAppendTo.append(StringOperations.encodeBytes(output, toAppendTo.getEncoding()));
526525
}
527526

528527
return toAppendTo;
Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,5 @@
1-
exclude :test_completion, "needs investigation"
2-
exclude :test_completion_with_different_timezone, "needs investigation"
3-
exclude :test_encode_httpdate, "needs investigation"
4-
exclude :test_encode_rfc2822, "needs investigation"
5-
exclude :test_encode_xmlschema, "needs investigation"
6-
exclude :test_huge_precision, "needs investigation"
7-
exclude :test_invalid, "needs investigation"
8-
exclude :test_nsec, "needs investigation"
9-
exclude :test_parse_fraction, "needs investigation"
10-
exclude :test_parse_leap_second, "needs investigation"
11-
exclude :test_rfc2616, "needs investigation"
12-
exclude :test_rfc2822, "needs investigation"
13-
exclude :test_rfc2822_leap_second, "needs investigation"
14-
exclude :test_rfc2822_utc_roundtrip_summer, "needs investigation"
15-
exclude :test_rfc2822_utc_roundtrip_winter, "needs investigation"
16-
exclude :test_rfc3339, "needs investigation"
17-
exclude :test_rfc822, "needs investigation"
18-
exclude :test_ruby_talk_152866, "needs investigation"
19-
exclude :test_strptime, "needs investigation"
20-
exclude :test_strptime_Ymd_z, "needs investigation"
21-
exclude :test_strptime_empty, "needs investigation"
22-
exclude :test_strptime_s_z, "needs investigation"
23-
exclude :test_xmlschema, "needs investigation"
24-
exclude :test_xmlschema_fraction, "needs investigation"
25-
exclude :test_xmlschema_leap_second, "needs investigation"
26-
exclude :test_zone_0000, "needs investigation"
27-
exclude :test_iso8601, "needs investigation"
28-
exclude :test_iso8601_alias, "needs investigation"
291
exclude :test_iso8601_encode, "needs investigation"
30-
exclude :test_iso8601_nsec, "needs investigation"
312
exclude :test_strptime_s_N, "needs investigation"
32-
exclude :test_xmlschema_alias, "needs investigation"
333
exclude :test_xmlschema_encode, "needs investigation"
34-
exclude :test_xmlschema_nsec, "needs investigation"
35-
exclude :test_iso8601_leap_second, "needs investigation"
36-
exclude :test_parse_offset_hour_minute_second, "needs investigation"
37-
exclude :test_strptime_j, "needs investigation"
38-
exclude :test_parse_with_various_object, "needs investigation"
4+
exclude :test_iso8601, "needs investigation"
5+
exclude :test_xmlschema, "needs investigation"

0 commit comments

Comments
 (0)