Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<format> assumes strings are encoded in the active code page #1834

Merged
merged 7 commits into from
Apr 20, 2021

Commits on Apr 15, 2021

  1. format assumes strings are encoded in the active code page

    Refactors all `format` functionality with knowledge of character encodings into a new class `_Fmt_codec`. `_Fmt_codec` internally caches the `_Cvtvec` structure that other functions previously passed around, and makes use of a new "pure C ABI function" `__std_get_cvt` to retrieve character conversion info for the active codepage.
    
    The ABI function reuses the `__std_code_page` and `__std_win_error` types from `<xfilesystem_abi.h>`. These could be extracted into a more general `__msvc_win_abi.hpp` header, but I think `<xfilesystem_abi.h>` is lightweight enough to just include directly for now.
    
    Drive-by:
    * BUG: `_Parse_precision` was not skipping the trailing `}` in a dynamic precision.
    * Improvement: `test_parse_helper` now verifies that the parse consumes the entire input when passed an expected length of `npos`.
    CaseyCarter authored and StephanTLavavej committed Apr 15, 2021
    Configuration menu
    Copy the full SHA
    8d298aa View commit details
    Browse the repository at this point in the history
  2. More hygienic testing method

    CaseyCarter authored and StephanTLavavej committed Apr 15, 2021
    Configuration menu
    Copy the full SHA
    eaa454f View commit details
    Browse the repository at this point in the history
  3. Review comments

    CaseyCarter authored and StephanTLavavej committed Apr 15, 2021
    Configuration menu
    Copy the full SHA
    9494a9c View commit details
    Browse the repository at this point in the history
  4. Remove confusing comment

    CaseyCarter committed Apr 15, 2021
    Configuration menu
    Copy the full SHA
    799a55a View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2021

  1. Add test coverage for width estimation

    ... fix 2 bugs exposed by that coverage, and address review comments. Drive-by: Remove the `_FORMAT_CODEPAGE` override from the `formatting_utf8` test which is unnecessary since we compile it with `/utf-8`.
    CaseyCarter committed Apr 16, 2021
    Configuration menu
    Copy the full SHA
    c6efbdb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    16c599c View commit details
    Browse the repository at this point in the history
  3. More review comments

    CaseyCarter committed Apr 16, 2021
    Configuration menu
    Copy the full SHA
    3f2944f View commit details
    Browse the repository at this point in the history