Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

silencing wide-character in-memory file handle error

RT#84198
  • Loading branch information...
commit dafec693a62fa1d40173f7780e837ceb1c110aea 1 parent a2c8980
Tom Wyant authored yanick committed
Showing with 12 additions and 1 deletion.
  1. +12 −1 t/02_request/14_uploads.t
View
13 t/02_request/14_uploads.t
@@ -16,9 +16,20 @@ sub test_path {
}
my $filename = "some_\x{1A9}_file.txt";
+my $filename_as_bytes = $filename;
+if ( $] >= 5.017009 ) {
+ # The following song-and-dance is because Perl has, in 5.17.9,
+ # started flagging wide characters in in-memory files as errors, to
+ # wit:
+ # Strings with code points over 0xFF may not be mapped into
+ # in-memory file handles
+ open my $out, '>:encoding(utf8)', \$filename_as_bytes;
+ print { $out } "some_\x{1A9}_file.txt";
+ close $out;
+}
my $content = qq{------BOUNDARY
-Content-Disposition: form-data; name="test_upload_file"; filename="$filename"
+Content-Disposition: form-data; name="test_upload_file"; filename="$filename_as_bytes"
Content-Type: text/plain
SHOGUN
Please sign in to comment.
Something went wrong with that request. Please try again.