Skip to content

Commit 4b9947f

Browse files
committed
Fix some unicode issues
1 parent a3778ea commit 4b9947f

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

Makefile.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SOURCES = \
2828
color_maps.cpp \
2929
environment.cpp \
3030
ast_fwd_decl.cpp \
31-
devlog.cpp \
31+
devlog.cpp \
3232
bind.cpp \
3333
file.cpp \
3434
util.cpp \

src/interpolation.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@
77

88

99
#include "interpolation.hpp"
10+
#include "utf8/checked.h"
1011

1112
#include "devlog.hpp"
1213

1314
namespace Sass {
1415

16+
void StringBuffer::writeCharCode(uint32_t character)
17+
{
18+
utf8::append(character, std::back_inserter(buffer));
19+
}
20+
21+
void InterpolationBuffer::writeCharCode(uint32_t character)
22+
{
23+
text.writeCharCode(character);
24+
}
25+
1526
Interpolation2* InterpolationBuffer::getInterpolation()
1627
{
1728
auto itpl = SASS_MEMORY_NEW(Interpolation2, "[pstate]");

src/interpolation.hpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ namespace Sass {
2222
buffer()
2323
{}
2424

25-
void writeCharCode(uint8_t character)
26-
{
27-
buffer.push_back(character);
28-
}
25+
void writeCharCode(uint32_t character);
26+
27+
// void write(uint32_t character);
2928

3029
void write(unsigned char character)
3130
{
@@ -37,11 +36,6 @@ namespace Sass {
3736
buffer.push_back(character);
3837
}
3938

40-
void write(uint32_t character)
41-
{
42-
// buffer.push_back(character);
43-
}
44-
4539
void write(const std::string& text)
4640
{
4741
buffer += text;
@@ -105,10 +99,7 @@ namespace Sass {
10599

106100
public:
107101

108-
void writeCharCode(uint8_t character)
109-
{
110-
text.write(character);
111-
}
102+
void writeCharCode(uint32_t character);
112103

113104
void addInterpolation(const String_Schema* schema);
114105
void addInterpolation(const Interpolation2* schema);

0 commit comments

Comments
 (0)