VirtualBox

Ignore:
Timestamp:
Apr 23, 2020 10:43:21 AM (5 years ago)
Author:
vboxsync
Message:

IPRT/RTUtf16Printf*: use U+fffd instead of U+007f as replacement for bad UTF-8 encodings. bugref:8489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/utf-16-printf.cpp

    r83837 r83943  
    8080                RTUNICP uc;
    8181                int rc = RTStrGetCpNEx(&pachChars, &cbChars, &uc);
    82                 AssertRCStmt(rc, uc = 0x7f);
     82                AssertRCStmt(rc, uc = 0xfffd /* REPLACEMENT */);
    8383
    8484                /* Simple: */
     
    115115                    cwcRet += 1;
    116116                    if (RT_LIKELY(cwcLeft > 1))
    117                         *pwszCur++ = 0x7f;
     117                        *pwszCur++ = 0xfffd; /* REPLACEMENT */
    118118                    else
    119119                        break;
     
    159159        RTUNICP uc;
    160160        int rc = RTStrGetCpNEx(&pachChars, &cbChars, &uc);
    161         AssertRCStmt(rc, uc = 0x7f);
     161        AssertRCStmt(rc, uc = 0xfffd /* REPLACEMENT */);
    162162
    163163        if (RTUniCpIsBMP(uc))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette