From e9f431015d9c5c770011b98ff45786c7fae6e2b4 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 9 Feb 2016 10:19:18 -0800 Subject: [PATCH] Handle signed char when considering @charset Resolves dahlia/libsass-python#117 --- src/output.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/output.cpp b/src/output.cpp index 800e2fc6f5..70fb998a5b 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -67,7 +67,8 @@ namespace Sass { // search for unicode char for(const char& chr : wbuf.buffer) { // skip all ascii chars - if (chr >= 0) continue; + // static cast to unsigned to handle `char` being signed / unsigned + if (static_cast(chr) < 128) continue; // declare the charset if (output_style() != COMPRESSED) charset = "@charset \"UTF-8\";"