Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/perlonjava/core/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public final class Configuration {
* Automatically populated by Gradle/Maven during build.
* DO NOT EDIT MANUALLY - this value is replaced at build time.
*/
public static final String gitCommitId = "cfdf262ba";
public static final String gitCommitId = "f83cf214c";

/**
* Git commit date of the build (ISO format: YYYY-MM-DD).
Expand All @@ -48,7 +48,7 @@ public final class Configuration {
* Parsed by App::perlbrew and other tools via: perl -V | grep "Compiled at"
* DO NOT EDIT MANUALLY - this value is replaced at build time.
*/
public static final String buildTimestamp = "Apr 30 2026 10:41:56";
public static final String buildTimestamp = "Apr 30 2026 12:00:17";

// Prevent instantiation
private Configuration() {
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/perlonjava/runtime/io/LayeredIOHandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,12 @@ private void addLayer(String layerSpec) {
inputPipeline = inputPipeline.andThen(inputTransform);
outputPipeline = outputPipeline.andThen(outputTransform);
}
case "utf8" -> {
// UTF-8 encoding layer - convenience alias for :encoding(UTF-8)
case "utf8", "utf8_strict" -> {
// UTF-8 encoding layer - convenience alias for :encoding(UTF-8).
// :utf8_strict (from the PerlIO::utf8_strict CPAN module) is treated
// as an alias for :utf8 here: the JVM's UTF-8 CharsetDecoder already
// rejects malformed sequences by default, which matches the "strict"
// semantics the XS module provides.
EncodingLayer layer = new EncodingLayer(StandardCharsets.UTF_8, "utf8");
activeLayers.add(layer);
Function<String, String> inputTransform = s -> layer.processInput(s);
Expand Down
33 changes: 33 additions & 0 deletions src/main/perl/lib/PerlIO/utf8_strict.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package PerlIO::utf8_strict;

use strict;
use warnings;

our $VERSION = '0.010';

# In standard Perl, PerlIO::utf8_strict is an XS module that provides
# a :utf8_strict PerlIO layer (a stricter UTF-8 layer that rejects
# malformed sequences). In PerlOnJava, IO layers are handled by the
# Java LayeredIOHandle implementation, which treats :utf8_strict as
# an alias for :utf8 (the JVM's UTF-8 decoder already rejects malformed
# input by default via CharsetDecoder, so the "strict" semantics are
# effectively the default).
#
# This stub lets `use PerlIO::utf8_strict;` succeed so CPAN modules
# whose prerequisite chain lists PerlIO::utf8_strict (e.g.
# Mixin::Linewise -> Config::INI -> Config::INI::Reader::Ordered ->
# Reply) can be loaded.

1;
__END__

=head1 NAME

PerlIO::utf8_strict - stub module for PerlOnJava

=head1 DESCRIPTION

Stub for PerlIO::utf8_strict. The C<:utf8_strict> layer is treated
as an alias for C<:utf8> by PerlOnJava's LayeredIOHandle.

=cut
Loading