Boost logo

Boost Users :

From: Arnold, Stefan (Stefan.Arnold_at_[hidden])
Date: 2022-06-08 18:07:15


Why is the IBM437 encoding not supported in boost::locale with the Win32 API ("wconv") backend?

The following call will fail with a boost::locale::conv::invalid_charset_error when using the Win32 API backend:

boost::locale::conv::to_utf<char>("abc", "IBM437")

This is because "ibm437" is not contained in the all_windows_encodings variable in wconv_codepage.ipp (nor is "cp437" or another alias).

As per Win32 API documentation (https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar, https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers), this encoding is supported in Win32 API. Furthermore, IBM437 is the legacy encoding of filenames in ZIP files, so it should be quite common.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net