brintos

brintos / llvm-project-archived public Read only

0
0
Text · 890 B · 9908ea0 Raw
33 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <iostream>10 11// wostream wcout;12 13// UNSUPPORTED: no-wide-characters14// REQUIRES: target={{.+}}-windows-{{.+}}15 16// FILE_DEPENDENCIES: test.dat17// RUN: %{build}18// RUN: %{exec} %t.exe > %t.actual19// RUN: diff test.dat %t.actual20 21// Check that wcout works, preserving the unicode characters, after switching22// stdout to wide mode.23 24#include <iostream>25#include <io.h>26#include <fcntl.h>27 28int main(int, char**) {29    _setmode(_fileno(stdout), _O_WTEXT);30    std::wcout << L"1234\u20ac\u00e5\u00e4\u00f6";31    return 0;32}33