EnricoMi commented on code in PR #48722:
URL: https://github.com/apache/arrow/pull/48722#discussion_r2664608101


##########
cpp/src/arrow/io/file_test.cc:
##########
@@ -115,7 +115,25 @@ TEST_F(TestFileOutputStream, 
FileNameWideCharConversionRangeException) {
   ASSERT_RAISES(Invalid, ReadableFile::Open(file_name));
 }
 
-// TODO add a test with a valid utf-8 filename
+TEST_F(TestFileOutputStream, FileNameValidUtf8) {
+  // Test that file operations work with valid UTF-8 filenames.
+  // On Windows, PlatformFilename::FromString() converts UTF-8 strings to wide 
strings.
+  // On Unix, filenames are treated as opaque byte strings.
+  std::string utf8_file_name = "test_file_한국어_😀.txt";
+  std::string utf8_path = TempFile(utf8_file_name);
+
+  ASSERT_OK_AND_ASSIGN(auto file, FileOutputStream::Open(utf8_path));
+  const char* data = "UTF-8 test data";

Review Comment:
   this string doesn't look UTF-8 specific, and test data is not target of this 
test anyway, may be confusing...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to