[Asterisk-code-review] utf8.c: Add UTF-8 validation and utility functions (asterisk[13])

Sean Bright asteriskteam at digium.com
Thu Jul 16 08:58:23 CDT 2020


Hello Joshua Colp, Friendly Automation, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/c/asterisk/+/14640

to look at the new patch set (#7).

Change subject: utf8.c: Add UTF-8 validation and utility functions
......................................................................

utf8.c: Add UTF-8 validation and utility functions

There are various places in Asterisk - specifically in regards to
database integration - where having some kind of UTF-8 validation would
be beneficial. This patch adds:

* Functions to validate that a given string contains only valid UTF-8
  sequences.

* A function to copy a string (similar to ast_copy_string) stopping when
  an invalid UTF-8 sequence is encountered.

* A UTF-8 validator that allows for progressive validation.

All of this is based on the excellent UTF-8 decoder by Björn Höhrmann.
More information is available here:

    https://bjoern.hoehrmann.de/utf-8/decoder/dfa/

The API was written in such a way that should allow us to replace the
implementation later should we determine that we need something more
comprehensive.

Change-Id: I3555d787a79e7c780a7800cd26e0b5056368abf9
---
A include/asterisk/utf8.h
M main/asterisk.c
A main/utf8.c
3 files changed, 572 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/40/14640/7
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14640
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I3555d787a79e7c780a7800cd26e0b5056368abf9
Gerrit-Change-Number: 14640
Gerrit-PatchSet: 7
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-CC: Stanislav Abramenkov <stas.abramenkov at gmail.com>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200716/e9dda589/attachment.html>


More information about the asterisk-code-review mailing list