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>
Fri, 19 Aug 2011 14:33:19 +0000 (14:33 +0000)
commit2da33e9a303d108d625aecdb627a96b5b14dd2cd
tree8d0cda257b8b337550346e3c28d97c3844f7f08f
parent8aa47cfb3f272cfbd7715d0131c9c13a62d4c473
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

Conflicts:

libcitadel/lib/stringbuf.c
libcitadel/lib/stringbuf.c