Git Product home page Git Product logo

utf8-json-string-unescaper's Introduction

UTF-8 JSON String Unescaper Written in C

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.

State Machine

Every transition between two states reads another char from the input buffer.
state machine

TODO

  1. Move it out of the scratch incubator
  2. Make a library of it (.h file) and put the main method somewhere else
  3. Write test cases
  4. Use it together with JSMN and write something cool.

DONE

  1. Support Unicode on top of the Basic multilingual plane
  2. 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
  3. Replace camelCase with under_scores in variable names.
  4. More code comments
  5. Format the code according to how they do it at fluent-bit

utf8-json-string-unescaper's People

Contributors

flodila avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.