Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ int TY_(DecodeUTF8BytesToChar)( uint* c, uint firstByte, ctmbstr successorBytes,
return 0;
}

int TY_(EncodeCharToUTF8Bytes)( uint c, tmbstr encodebuf,
int TY_(EncodeCharToUTF8BytesSlow)( uint c, tmbstr encodebuf,
TidyOutputSink* outp, int* count )
{
byte tempbuf[10] = {0};
Expand Down
15 changes: 14 additions & 1 deletion src/utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@
TY_PRIVATE int TY_(DecodeUTF8BytesToChar)( uint* c, uint firstByte, ctmbstr successorBytes,
TidyInputSource* inp, int* count );

TY_PRIVATE int TY_(EncodeCharToUTF8Bytes)( uint c, tmbstr encodebuf,
TY_PRIVATE int TY_(EncodeCharToUTF8BytesSlow)( uint c, tmbstr encodebuf,
TidyOutputSink* outp, int* count );

static inline int TY_(EncodeCharToUTF8Bytes)(uint c, tmbstr encodebuf,
TidyOutputSink *outp, int *count) {
if (c <= 0x7F) {
if (encodebuf)
encodebuf[0] = c;
if (outp)
outp->putByte(outp->sinkData, c);
*count = 1;
return 0;
}

TY_(EncodeCharToUTF8BytesSlow)(c, encodebuf, outp, count);
}

TY_PRIVATE uint TY_(GetUTF8)( ctmbstr str, uint *ch );
TY_PRIVATE tmbstr TY_(PutUTF8)( tmbstr buf, uint c );
Expand Down