Skip to content

Instantly share code, notes, and snippets.

View drikosev's full-sized avatar

Evangelos Drikos drikosev

View GitHub Profile
@rprichard
rprichard / emutls-dtor-problem.cpp
Created May 9, 2018 21:52
Demonstrate emutls + thread_local dtor bug
// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@rechardchen
rechardchen / unicode_utf8.cc
Created August 11, 2012 06:30
C++: convert between utf8 and unicode
wstring UTF8toUnicode(const string& s)
{
wstring ws;
wchar_t wc;
for( int i = 0;i < s.length(); )
{
char c = s[i];
if ( (c & 0x80) == 0 )
{
wc = c;