Skip to content

Commit 0a4982f

Browse files
committed
fix(sass.util): adapting to new UTF8 string methods
1 parent 02acb83 commit 0a4982f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sass.util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ function pointerToString(pointer) {
2929
function stringToPointer(text) {
3030
// a character like ” takes 3 bytes, while .length would return 1
3131
// see https://github.com/medialize/sass.js/issues/72#issuecomment-263916386
32-
var bytes = unescape(encodeURIComponent(text)).length;
32+
var bytes = Module.lengthBytesUTF8(text);
3333
var buffer = Module._malloc(bytes + 1);
34-
Module.writeStringToMemory(text, buffer);
34+
Module.stringToUTF8(text, buffer, bytes + 1);
3535
return buffer;
3636
}
3737

0 commit comments

Comments
 (0)