Skip to content

Instantly share code, notes, and snippets.

View dreamforceinc's full-sized avatar

Vladislav Salikov dreamforceinc

  • Vorkuta, Russia
View GitHub Profile
@VeryCrazyDog
VeryCrazyDog / ReadUtfFile.cpp
Last active August 28, 2023 13:31
UTF File to UTF-8 in std::string in C++ on Windows
// Reading ASCII, UTF-8, UTF-16LE, UTF-16BE with auto BOM detection using C++11 on Windows platform
// Code tested on Microsoft Visual Studio 2013 on Windows 7
// Part of the code is referencing http://cfc.kizzx2.com/index.php/reading-a-unicode-utf16-file-in-windows-c/
#include <stdio.h>
#include <tchar.h>
#include <string>
#include <fstream>
#include <sstream>
#include <locale>