sass/libsass — pull request #461 by mgreter (2014-08-10 20:17:37+00:00)
Title: Fixes to-upper and to-lower to skip utf8 code points

Tried the latest spec test suite today and encountered one error.

```
# Failed test 'sass-spec t/sass-spec/spec/basic/48_case_conversion/input.scss'
# at t\99_sass_specs.t line 68.
# got: 'div {
# bar: "BLAH";
# bar: "BLAH";
# bar: "BLAH";
# bar: "1232178942";
# bar: "├©├í├®├¡├│├║├╝├▒┬┐├®├á┼ñÃàÃé╔è╔▒╩¡╩¼Ð¬Êê¦ô";
# bar: BLAH;
# bar: BLAH;
# bar: BLAH;
# bar: "";
# bar: "blah";
# bar: "BLAH";
# bar: "bLaH";
# bar: "1232178942";
# bar: "Ò©ÒíÒ®Ò¡Ò│Ò║Ò╝Ò▒Ô┐Ò®ÒáÕñþàþéÚÜÚ▒Û¡Û¼±¬‗ê²ô";
# bar: blah;
# bar: BLAH;
# bar: bLaH;
# bar: ""; }'
# expected: 'div {
# bar: "BLAH";
# bar: "BLAH";
# bar: "BLAH";
# bar: "1232178942";
# bar: "├©├í├®├¡├│├║├╝├▒┬┐├®├á┼ñÃàÃé╔è╔▒╩¡╩¼Ð¬Êê¦ô";
# bar: BLAH;
# bar: BLAH;
# bar: BLAH;
# bar: "";
# bar: "blah";
# bar: "blah";
# bar: "blah";
# bar: "1232178942";
# bar: "├©├í├®├¡├│├║├╝├▒┬┐├®├á┼ñÃàÃé╔è╔▒╩¡╩¼Ð¬Êê¦ô";
# bar: blah;
# bar: blah;
# bar: blah;
# bar: ""; }'
```

The windows console is not utf8 aware, but you still should see that to-lower changed the unicode string. Fix was pretty obvious and now libsass seems to pass all spec tests again. I guess it was assumed that std::toupper and std::tolower would only work on ascii characters. I have no idea why this is not the case on my platform (Windows 7 and Strawberry Perl, which provides the compiler gcc version 4.6.3 (gcc-4.6.3 release with patches [build 20121012 by perlmingw.sf.net])).