- if (*outbytesleft < 3) {
- LOG(log_debug, logtype_default, "short utf8 write");
- goto toobig;
+ if ( uc >= 0x202a && uc <= 0x202e ) {
+ /* ignore bidi hint characters */
+ len = 0;
+ }
+ else {
+ if (*outbytesleft < 3) {
+ LOG(log_debug, logtype_default, "short utf8 write");
+ goto toobig;
+ }
+ c[2] = 0x80 | (uc & 0x3f);
+ uc = uc >> 6;
+ uc |= 0x800;
+ c[1] = 0x80 | (uc&0x3f);
+ uc = uc >> 6;
+ uc |= 0xc0;
+ c[0] = uc;
+ len = 3;