diff options
author | Matthias Kramm <kramm@quiss.org> | 2011-12-24 12:27:45 -0800 |
---|---|---|
committer | Matthias Kramm <kramm@quiss.org> | 2011-12-24 12:27:45 -0800 |
commit | d9afddd85be825c925ec724a80312b2e2433a1c3 (patch) | |
tree | e83816ead4c457c8b1012c76887fcf7f6fbe92d2 | |
parent | e6bb303bc611d8d28c24ea0731f23ac5293cfdb8 (diff) |
applied utf8 patch from George Prekas
-rw-r--r-- | src/swfdump.c | 11 | ||||
-rw-r--r-- | src/swfstrings.c | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/swfdump.c b/src/swfdump.c index 1500d0b5..2ef1cefb 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -39,6 +39,7 @@ #include <stdarg.h> #include "../lib/rfxswf.h" #include "../lib/args.h" +#include "../lib/utf8.h" static char * filename = 0; @@ -398,7 +399,7 @@ void textcallback(void*self, int*glyphs, int*xpos, int nr, int fontid, int fonts for(t=0;t<nr;t++) { - unsigned char a; + unsigned int a; if(font>=0) { if(glyphs[t] >= fonts[font]->numchars /*glyph is in range*/ || !fonts[font]->glyph2ascii /* font has ascii<->glyph mapping */ @@ -412,10 +413,12 @@ void textcallback(void*self, int*glyphs, int*xpos, int nr, int fontid, int fonts } else { a = glyphs[t]; } - if(a>=32) - printf("%c", a); - else + if(a>=32) { + char* utf8 = getUTF8(a); + printf("%s", utf8); + } else { printf("\\x%x", (int)a); + } } printf("\n"); } diff --git a/src/swfstrings.c b/src/swfstrings.c index c71d9142..27494b42 100644 --- a/src/swfstrings.c +++ b/src/swfstrings.c @@ -149,7 +149,7 @@ void textcallback(void*self, int*glyphs, int*advance, int nr, int fontid, int fo } } - unsigned char a; + unsigned int a; int advance = 0; if(font) { if(glyphs[t]<0 || glyphs[t] >= font->numchars /*glyph is not in range*/ |