I noticed several issues with the current reference implementation:
compare_name is not implemented according to Charset_Alias_Matching (The correct implementation doesn't handle '-' and '_' in a special way)
"IBBM904" has not been renamed as specified
mib values 33 (NATSDANO) and 34 (NATSDANOADD) are not eliminated as specified
lower_bound usage is incorrect, since the used array is not sorted for two reasons: (a) The original mib order is not sorted (e.g. PC8CodePage437 with mib=2011 follows IBM424 with mib=2043), and (b) the added nullptr sentinel value for details::data does also break the sorting and is currently part of the lower_bound call.
The implementation of encoding_alias_view::iterator::operator<=> is defect
The hash specialization is missing
The text_encoding implementation is defect for the following reasons:
text_encoding::max_name_length is missing
text_encoding::name_ is too short
The internal text_encoding constructor incorrectly maps everyid::unknown to id::other (It must not do that if the corresponding mib constructor is called)
The implementation of operator== is broken due to multiple reasons, among them that name comparison must only happen if both encodings have id::other as mib value and because name equality is used instead of compare_name
text_encoding constructions involving details::mib_from_page are broken, because they don't invoke the internal constructor that assigns the name correctly
I noticed several issues with the current reference implementation:
compare_name
is not implemented according to Charset_Alias_Matching (The correct implementation doesn't handle '-' and '_' in a special way)lower_bound
usage is incorrect, since the used array is not sorted for two reasons: (a) The original mib order is not sorted (e.g.PC8CodePage437
with mib=2011 followsIBM424
with mib=2043), and (b) the added nullptr sentinel value fordetails::data
does also break the sorting and is currently part of the lower_bound call.encoding_alias_view::iterator::operator<=>
is defecthash
specialization is missingtext_encoding
implementation is defect for the following reasons:text_encoding::max_name_length
is missingtext_encoding::name_
is too shorttext_encoding
constructor incorrectly maps everyid::unknown
toid::other
(It must not do that if the corresponding mib constructor is called)operator==
is broken due to multiple reasons, among them that name comparison must only happen if both encodings haveid::other
as mib value and because name equality is used instead ofcompare_name
text_encoding
constructions involvingdetails::mib_from_page
are broken, because they don't invoke the internal constructor that assigns the name correctly