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 18:24:17 +0000 (18:24 +0000)
commit8f87964ec3d88db935146edbfbb77e51eb8da841
tree6cd4219c06f742eb0503d2758e775005af58a737
parent0ad461a910276d955b747f2d8174055067e76854
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