Skip to content

Invalid multi-byte sequences cause internal file translations (to UTF8) to fail #13150

Closed

Description

Opening this to track an issue I noticed while investigating: #13078

If files.encoding is set to a multi-byte encoding, and an invalid multi-byte sequence is detected, the translation would fail. This should instead skip the invalid sequece and continue trying to translate the encoding.

Activity

  1. moved this from Pull Request to Done in cpptoolson Jan 15, 2025
  2. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Jan 15, 2025
  3. v-frankwang commented on Feb 20, 2025

    @v-frankwang

    Colen Garoutte-Carson (@Colengms) Sean McManus (@sean-mcmanus) We went to verify the issue in the latest C++ extension 1.24.1 (pre-release) according to the following steps, is the gif showing the expected result?
    If our validation steps are not correct, could you share our detailed validation steps?

    Verification Steps:

    1. Create a Demo folder in PC.
    2. Open Demo with VSCode, then add a .cpp file and paste the following code:
    #include <iostream>
     
    int main() {
        
        const char* invalidSequence = "\xC3\x28"; // Invalid UTF-8 sequence
        std::cout << "Invalid sequence: " << invalidSequence << std::endl;
        return 0;
    }
    
    1. Navigate to the bottom toolbar and select the GB18030 encode.
    2. Run the .cpp file.

    Verification Results: Skip invalid sequece and run the file successfully

    Image

  4. locked and limited conversation to collaborators on Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.world readyAn issue relating string character encodings, localization translations, etc.

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions