Codechange: use \u to indicate unicode chars in strings (#8379)

With \x, we sometimes had to do the "" trick, as the length is not
predefined. With C++11 bringing \u to the specs, which has a preset
length, we no longer need the "" trick.

We set the strings to u8, to ensure all compilers use UTF-8 encoding
for the \u characters.

This was triggered by newer CLangs, which start to warn if you
use "" in the middle of a string, wondering if that was your
intention. It is a good question. And this is our answer :)
This commit is contained in:
Patric Stout
2020-12-14 20:25:01 +01:00
committed by GitHub
parent b14e3b9b9d
commit 68f9925cd4
6 changed files with 650 additions and 650 deletions

View File

@@ -15,10 +15,10 @@
#include <string>
/** A non-breaking space. */
#define NBSP "\xC2\xA0"
#define NBSP u8"\u00a0"
/** A left-to-right marker, marks the next character as left-to-right. */
#define LRM "\xE2\x80\x8E"
#define LRM u8"\u200e"
/**
* Valid filter types for IsValidChar.