Benjamin Otte
2007-Jul-02 11:06 UTC
[Swfdec] [PATCH] Implement CharToAscii + simple testcase
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 > >
Reasonably Related Threads
- Branch 'as' - 4 commits - libswfdec/swfdec_as_interpret.c test/trace
- Branch 'as' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
- libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_bits.c
- 5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
- [PATCH] Implement StringLength + simple testcase.