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

curl_multibyte: Remove local encoding fallbacks #7257

Closed
wants to merge 1 commit into from

Commits on Jun 16, 2021

  1. curl_multibyte: Remove local encoding fallbacks

    - If the UTF-8 to UTF-16 conversion fails in Windows Unicode builds then
      no longer fall back to assuming the string is in a local encoding.
    
    Background:
    
    Some functions in Windows Unicode builds must convert UTF-8 to UTF-16 to
    pass to the Windows CRT API wide-character functions since in Windows
    UTF-8 is not a valid locale (or at least 99% of the time right now).
    
    Prior to this change if the Unicode encoding conversion failed then
    libcurl would assume, for backwards compatibility with applications that
    may have written their code for non-Unicode builds, attempt to convert
    the string from local encoding to UTF-16.
    
    That type of "best effort" could theoretically cause some type of
    security or other problem if a string that was locally encoded was also
    valid UTF-8, and therefore an unexpected UTF-8 to UTF-16 conversion
    could occur.
    
    Ref: curl#7246
    
    Closes #xxxx
    jay committed Jun 16, 2021
    Copy the full SHA
    cb52b96 View commit details
    Browse the repository at this point in the history