I had some issues with the
Kubernetes filter in fluent-bit.
And I believed that its unescape_string
function might be the problem.
Now I wanted to fix it but really don't have any experience in programming C ...
This is my approach for unescaping a JSON string.
Every transition between two states reads another char from the input
buffer.
- Move it out of the scratch incubator
- Make a library of it (.h file) and put the main method somewhere else
- Write test cases
- Use it together with JSMN and write something cool.
- Support Unicode on top of the Basic multilingual plane
- Escape UTF-8 with bit shifting. Devide and modulo works but the former is easier to read and probably faster. See https://github.com/akheron/jansson/blob/master/src/utf.c
- Replace camelCase with under_scores in variable names.
- More code comments
- Format the code according to how they do it at fluent-bit