We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ee65eb5 + df8ff3a commit c890f92Copy full SHA for c890f92
src/position.cpp
@@ -54,17 +54,15 @@ namespace Sass {
54
// https://stackoverflow.com/a/9356203/1550314
55
// https://en.wikipedia.org/wiki/UTF-8#Description
56
unsigned char chr = *begin;
57
- // skip over 10xxxxxx
58
- // is 1st bit not set
59
- if ((chr & 128) == 0) {
+ // Ignore all `10xxxxxx` chars
+ // '0xxxxxxx' are ASCII chars
+ // '11xxxxxx' are utf8 starts
60
+ // 64 => initial utf8 byte
61
+ // 128 => regular ASCII char
62
+ if ((chr & 192) != 128) {
63
// regular ASCII char
64
column += 1;
65
}
- // is 2nd bit not set
- else if ((chr & 64) == 0) {
- // first utf8 byte
66
- column += 1;
67
- }
68
69
++ begin;
70
0 commit comments