[FFmpeg-devel] [RFC] function to check for valid UTF-8 string

Michael Niedermayer michaelni
Sun Dec 9 15:33:12 CET 2007


Hi

On Sun, Dec 09, 2007 at 03:19:26PM +0100, Reimar D?ffinger wrote:
> Hello,
> On Sun, Dec 09, 2007 at 02:40:51PM +0100, Michael Niedermayer wrote:
> > On Sun, Dec 09, 2007 at 11:18:32AM +0100, Reimar D?ffinger wrote:
> > > since Rich seems to have given up on it, here is a proposed patch
> > > that adds a av_check_utf8 function that could be used to validate
> > > input strings.
> > > Since it hacked it up very quickly please forgive any bugs or other
> > > stupidity.
> > 
> > maybe the function should return a index to the last valid or first
> > invalid byte or something like that?
> 
> Don't know. But I can easily change the "return 0;" to "return last;" and
> "return 1;" to "return NULL;", so it would point to the start of the
> first invalid unicode character, which would allow for easy truncating
> of invalid strings, though I don't consider that too useful.

well i think it is usefull, feel free to commit with that 

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071209/61052749/attachment.pgp>



More information about the ffmpeg-devel mailing list