From 9a5c78b7256427e524e1e8fff0e2491c0c960a6c Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 14 Jun 2019 18:07:59 +0200 Subject: [PATCH] Don't consider UTF-8 an encoding which can be used in ID3v1 UTF-8 within ID3v1 is still supported relying on the presence of the BOM. However, the library should not advise that to tag editing clients. --- id3/id3v1tag.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/id3/id3v1tag.cpp b/id3/id3v1tag.cpp index a3e45fd..05c1a88 100644 --- a/id3/id3v1tag.cpp +++ b/id3/id3v1tag.cpp @@ -37,9 +37,17 @@ const char *Id3v1Tag::typeName() const return tagName; } +/*! + * \brief Returns only true for TagTextEncoding::Latin1. + * \remarks + * The encoding to be used within ID3v1 tags is not standardized but it seems that Latin-1 is the most + * commonly used character set and hence safest to use. Hence that is the only encoding which can be safely + * recommended here. Despite that, the Id3v1Tag class is actually able to deal with UTF-8 as well. It will + * use the BOM to detect and serialize UTF-8. + */ bool Id3v1Tag::canEncodingBeUsed(TagTextEncoding encoding) const { - return encoding == TagTextEncoding::Latin1 || encoding == TagTextEncoding::Utf8; + return encoding == TagTextEncoding::Latin1; } /*!