VirtualBox

Changeset 95043 in vbox


Ignore:
Timestamp:
May 19, 2022 11:52:24 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/testcase: A few more comments and diagnosis for Windows runs in for tstUtf8/testNoTranslation().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstUtf8.cpp

    r95041 r95043  
    4444#include <iprt/uuid.h>
    4545
     46#ifdef RT_OS_WINDOWS
     47# include <iprt/win/windows.h> /* For GetACP(). */
     48#endif
    4649
    4750
     
    14731476     * Try trigger a VERR_NO_TRANSLATION error in convert to
    14741477     * current CP to latin-1.
    1475      */
     1478     *
     1479     * On Windows / DOS OSes this is codepage 850.
     1480     *
     1481     * Note! On Windows-y systems there ALWAYS are two codepages active:
     1482     *       the OEM codepage for legacy (console) applications, and the ACP (ANSI CodePage).
     1483     *       'chcp' only will tell you the OEM codepage, however.
     1484     */
     1485
     1486    /* Unicode code points (some of it on 2300-23FF -> misc. technical) to try. */
    14761487    const RTUTF16 s_swzTest1[] = { 0x2358, 0x2242, 0x2357, 0x2359,  0x22f9, 0x2c4e, 0x0030, 0x0060,
    14771488                                   0x0092, 0x00c1, 0x00f2, 0x1f80,  0x0088, 0x2c38, 0x2c30, 0x0000 };
     
    14791490    int rc = RTUtf16ToUtf8(s_swzTest1, &pszTest1);
    14801491    RTTESTI_CHECK_RC_RETV(rc, VINF_SUCCESS);
     1492
     1493#ifdef RT_OS_WINDOWS
     1494    UINT const uACP = GetACP();
     1495    RTTestIPrintf(RTTESTLVL_ALWAYS, "Current Windows ANSI codepage is: %u%s\n",
     1496                  uACP, uACP == 65001 /* UTF-8 */ ? " (UTF-8)" : "");
     1497#endif
    14811498
    14821499    RTTestSub(hTest, "VERR_NO_TRANSLATION/RTStrUtf8ToCurrentCP");
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