[Swfdec] [PATCH] Implement CharToAscii + simple testcase

Benjamin Otte otte at gnome.org
Mon Jul 2 04:06:57 PDT 2007


I overhauled it a bit before committing.

Some notes:
1) makeswf uses the C preprocessor and defines some useful macros, one
of them being __SWF_VERSION__. So if you have code that only compiles
in version 5+, you can use someting like:
#if __SWF_VERSION__ >= 5
to comment it out for version 4.
2) All strings in Swfdec are valid UTF-8. So if there's some unchecked
string, you must verify it before pasing it on to Swfdec. All the
swfdec_bits functions do that.
3) Flash <=5 uses Latin1, so text has to be explicitly converted all
the time. That's why the String functions are always special cased for
those versions. We have to be extra careful to not assume just Latin1
though, since Flash 5 movies can be loaded into Flash 7 movies, and
those can contain strings that are not convertible into Latin1. I've
never seen that, but since Swfdec should never crash...

Benjamin


On 6/29/07, Andreas Henriksson <andreas at fatal.se> wrote:
> Hopefully I got it all right in the end with unicode characters in
> CharToAscii which behaves different for old/new versions.
>
> You'll find my patch attached as well as a simple testcase.
>
> --
> Regards,
> Andreas Henriksson
>
>


More information about the Swfdec mailing list