diff --git a/tests/examples/test_UTF-16LE.txt b/tests/examples/test_UTF-16LE.txt new file mode 100644 index 00000000..d43fec4c Binary files /dev/null and b/tests/examples/test_UTF-16LE.txt differ diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index c0c282e3..7d9856ac 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -436,3 +436,15 @@ fn config_read_arguments_from_file() { .success() .stdout("dummy-pager-from-config\n"); } + +#[test] +fn utf16() { + // The output will be converted to UTF-8 with a leading UTF-8 BOM + bat() + .arg("--plain") + .arg("--decorations=always") + .arg("test_UTF-16LE.txt") + .assert() + .success() + .stdout(std::str::from_utf8(b"\xEF\xBB\xBFhello world\n").unwrap()); +}