Fix StrHtmlEcmaEscAppend() more edge cases in utf8 handling
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 18 Aug 2011 17:53:18 +0000 (17:53 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 18 Aug 2011 17:53:18 +0000 (17:53 +0000)
commitb99742c47d35d56eaa2176d84dab357f2932cac4
tree3625c77cd9916e036ab0399a1c8bbd7936046df6
parentfe1e4e35702b1b19045264596f39bda0c1f7f183
Fix StrHtmlEcmaEscAppend() more edge cases in utf8 handling

 - Ctdl_GetUtf8SequenceLength(): return 0 for broken, 1 for non-utf8 sequences
 - StrHtmlEcmaEscAppend(): another attempt to fix json appending:
  - use switch instead of Rumpelstilskin if sequence
  - use HKEY for our static sequences
  - don't check for buffer expansion again while utf8-handling; we have 11 bytes reserved, utf8 will at most become 6 bytes
  - Simply handle ASCII chars in the utf8 loop
  - since aptr is moved implicitely, we mustn't move it for the last byte
  - add missing handling for some escapers
  - let unicode escapers pass
libcitadel/lib/stringbuf.c