[FFmpeg-devel] [PATCH] lavu/avstring: add av_get_utf8() function

Stefano Sabatini stefasab at gmail.com
Wed Nov 13 14:35:00 CET 2013


On date Sunday 2013-11-10 13:16:44 +0100, Stefano Sabatini encoded:
> On date Friday 2013-11-08 11:41:36 +0100, Stefano Sabatini encoded:
> > On date Thursday 2013-11-07 15:40:54 -0800, Timothy Gu encoded:
> > > On Nov 7, 2013 2:22 PM, "Lukasz M" <lukasz.m.luki at gmail.com> wrote:
> > [...]
> > > > > av_get_utf8_code()?
> > > > > av_get_code_from_utf8()?
> > > > > av_decode_utf8()?
> > > > >
> > > > > I don't mind changing the name of the function.
> > > > >
> > > >
> > 
> > > > When I poseted I had av_get_code_from_utf8() in mind, but all seems OK.
> > > 
> > > I prefer av_decode_utf8 which seems to be the shortest while preserving the
> > > true meaning.
> > 
> > or av_utf8_decode(), in case we add av_utf8_encode().
> > 
> > Still waiting for a complete review, will auto-review and push in
> > three days if I see none.
> 
> Updated, renamed to av_utf8_decode() to provide hierarchical naming
> (and help intellisense in case we add av_utf8_encode()).
> 
> I also added another parameter to deal with buffer overreads in case
> of unterminated sequences towards the end of a buffer.
> 
> Please comment, I'd like to push it soon.
> -- 
> FFmpeg = Fanciful and Friendly Monstrous Political Erroneous Geisha

> From 55d076a23a9e41d2d5af0222221471af1d2a30e5 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Thu, 3 Oct 2013 01:21:40 +0200
> Subject: [PATCH] lavu/avstring: add av_utf8_decode() function
> 
> TODO: minor bump, APIchanges entry
> ---
>  libavutil/Makefile   |  1 +
>  libavutil/avstring.c | 40 ++++++++++++++++++++++++++++++
>  libavutil/avstring.h | 19 +++++++++++++++
>  libavutil/utf8.c     | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 129 insertions(+)
>  create mode 100644 libavutil/utf8.c

Updated again, with some fixes and a new flags paramter.

The problem with the previous version was that it was allowing to
specify invalid Unicode codes, which was resulting in particular in
invalid XML files.

The flags argument should also allow to extend the funtion.
-- 
FFmpeg = Fabulous and Frightening Multimedia Proud EnGine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavu-avstring-add-av_utf8_decode-function.patch
Type: text/x-diff
Size: 7409 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131113/15d1349c/attachment.bin>


More information about the ffmpeg-devel mailing list