FS#74895 - [flac] metaflac always detects locale as US-ASCII
Attached to Project:
Arch Linux
Opened by Joost Molenaar (j0057_1) - Sunday, 29 May 2022, 10:23 GMT
Last edited by Jan Alexander Steffens (heftig) - Sunday, 10 July 2022, 10:17 GMT
Opened by Joost Molenaar (j0057_1) - Sunday, 29 May 2022, 10:23 GMT
Last edited by Jan Alexander Steffens (heftig) - Sunday, 10 July 2022, 10:17 GMT
|
Details
Description:
When running metaflac to set tags in .flac files, and passing in non-ASCII values for the vorbis comments fields, all non-ASCII characters are replaced with fallback characters. One option is to pass in the --no-utf8-convert option or to set the CHARSET environment variable to UTF-8, but this wouldn't be needed if the package were compiled with HAVE_LANGINFO_CODESET defined. The bug happens in the current_charset() function in utf8.c[1]; if compiled without -DHAVE_LANGINFO_CODESET=ON, the function only looks at the CHARSET environment variable and falls back to US-ASCII if it's undefined. I tested that adding -DHAVE_LANGINFO_CODESET=ON to the PKGBUILD solves the issue. [1] https://github.com/xiph/flac/blob/1.3.4/src/share/utf8/utf8.c#L133-L144 Additional info: Package version 1.3.4-2 Steps to reproduce: 1. copy some flac file to /tmp/test.flac 2. metaflac /tmp/test.flac --set-tag ARTIST="DJ Krush" --set-tag ALBUM="漸 -Zen-" 3. metaflac /tmp/test.flac --list --block-type VORBIS_COMMENT With a metaflac compiled without HAVE_LANGINFO_CHARSET, step 2 puts in the '#' fallback character for non-ASCII bytes in the metadata, and step 3 outputs the '?' as fallback for non-ASCII bytes. In case Flyspray mangles the second step, a Unicode-safe invocation (from Bash) is: metaflac /tmp/test.flac --set-tag ARTIST="DJ Krush" --set-tag ALBUM=$'\u6F38 -Zen-' |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Sunday, 10 July 2022, 10:17 GMT
Reason for closing: Fixed
Additional comments about closing: flac 1.3.4-3
Sunday, 10 July 2022, 10:17 GMT
Reason for closing: Fixed
Additional comments about closing: flac 1.3.4-3
This also affects encoding with flac(1) and can be confirmed as follows:
* ffmpeg -loglevel quiet -f lavfi -i anullsrc -t 1 test.wav
* flac -f -T "TITLE=無" test.wav
* ffprobe -hide_banner test.flac