summaryrefslogtreecommitdiff
path: root/test/test_flac.sh
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-05-12 22:21:39 +0200
committerGitHub <noreply@github.com>2022-05-12 22:21:39 +0200
commit61649d09aa21ae173fb0f3d95269b1ad5c457b19 (patch)
tree98511c317e6f5a1ad9dae1824129334bfb05813c /test/test_flac.sh
parent1bec35e33757fc38261b0acfa3c032e720d2baf0 (diff)
downloadflac-61649d09aa21ae173fb0f3d95269b1ad5c457b19.tar.gz
Add checks for decoding from and encoding to UTF-8 filenames
Diffstat (limited to 'test/test_flac.sh')
-rwxr-xr-xtest/test_flac.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_flac.sh b/test/test_flac.sh
index 75e995d6..6ecd0f66 100755
--- a/test/test_flac.sh
+++ b/test/test_flac.sh
@@ -1290,6 +1290,36 @@ if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
test_total_samples_overflow 68719476737 0
fi
+############################################################################
+# test handling of UTF-8 filenames
+############################################################################
+
+
+test_utf8_handling ()
+{
+ echo $ECHO_N "Test decoding from $1... " $ECHO_C
+ run_flac -d $testdatadir/$1 -o out.wav
+ if [ -f out.wav ] ; then
+ echo "OK"
+ else
+ die "Decoding failed"
+ fi
+ echo $ECHO_N "Test encoding to $1... " $ECHO_C
+ run_flac out.wav -o $1
+ if [ -f $1 ] ; then
+ echo "OK"
+ else
+ die "Encoding failed"
+ fi
+ rm $1 out.wav
+}
+
+if [ "$WIN32BUSYBOX" != "yes" ]; then
+ test_utf8_handling שלום.flac
+ test_utf8_handling 🤔.flac
+ test_utf8_handling Prøve.flac
+fi
+
rm -f out.flac out.meta out1.meta
#@@@ when metaflac handles ogg flac, duplicate flac2flac tests here