swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] Re: your response on DBCS and SWF / UTF-8


From: Bill Hall
Subject: [Swftools-common] Re: your response on DBCS and SWF / UTF-8
Date: Sun, 13 Aug 2006 10:54:24 -0400

Matthias,

 Thanks for the answers. They help!


1.) swfc will accept UTF-8 encoded files, but only without a DOM.
    That could be considered a bug, so I'm putting this on my TODO list.
    Could you please send me one of your test files (one of the ones
    with a DOM at the start?)


I'll send a file  that includes the BOM (byte order mark) for UTF-8 on the front.
Yes I tried it and it works without the BOM.

2.) swfc uses the Actionscript compiler von the Ming Flash library.
    While normal swfc syntax (e.g. textshape) support's both UTF-8 input
    and escaped Unicode (\uxxxx), I'm not sure about the Actionscript
    compiler. (Anything between the .action: and the .end is processed
    by a different lexer and grammar)

    What would probably work (didn't try it) is to escape not the
    Unicode, but the UTF-8:
    Instead of
        this.Controls.titled = "DB2 \u8D2D\u7269\u7BEE\u5206\u6790"
    write
        this.Controls.titled = "DB2 \xe2\xb6\x8d\xe6\xa5\xb2\xee\xb9\xbb\xd9\x92\xe9\x81\xa7"

    with the latter being the byte-encoded UTF8 version of the UTF16
    data of the original line.

2A.
 Actually, if I did this test  correctly , it didn't compile.

This file:
.flash name="variablezh1x.swf" version=6
    .action:
        this.controls.frameRate = 15;
        this.Controls.titled = "DB2 \xe2\xb6\x8d\xe6\xa5\xb2\xee\xb9\xbb\xd9\x92\xe9\x81\xa7"
    .end
.end

gave Error messages:
        this.Controls.titled = "DB2 \xe2\xb6\x8d\xe6\xa5\xb2\xee\xb9\xbb\xd9\x9
\xe9\x81\xa7"


            ^
warning:

            ^

Line 0005:  Reason: 'unsupported escape sequence'
warning:
Line 0005:  Reason: 'unsupported escape sequence'
error:
Line 7: Reason: 'Unexpected EOF found while looking for input.'
"variablezh1x.sc", line 2 column 12: error- Couldn't compile ActionScript

2B.
 the original unicode escaped file gives warning messages, I assume this was due to the font issues
but seems to compile.  Is the data there?  It seems to be via a swfdump but maybe I misunderstand.

i.e.
.flash name="variablezh1.swf" version=6
    .action:
        this.controls.frameRate = 15;
        this.Controls.titled = "DB2 \uE8B4\uADE7\u89A9\uE7AF\uAEE5\u8886\uE69E\u90";
    .end
.end

gives warning.

warning:
        this.Controls.titled = "DB2 \uE8B4\uADE7\u89A9\uE7AF\uAEE5\u8886\u
90"


  ^
warning:

  ^

Line 0005:  Reason: 'unsupported escape sequence'
warning:
Line 0005:  Reason: 'unsupported escape sequence'
"variablezh1.sc ", line 6 column 1: warning- Empty bounding box for movie

seems to compile with warnings.

3.) The problem you wrote in the other mail:

    C:\PlayerIn\sc>c:\swftools\swfc fontoutline1.sc -o font-zh1.swf
    No char 59572 in font SimSun
    No char 44519 in font SimSun
    No char 59311 in font SimSun
    No char 44773 in font SimSun
    No char 59038 in font SimSun
    No char 144 in font SimSun

    suggests that the UTF8 encoding itself worked (59572 = \xe8b4), but
    there was a problem in the font.
    Could you send me both the SimSun.ttf file as well as the converted
    font (SimSun.swf)? Thanks!


 I'll send the files but I resolved this issue  (I think).
 fontoutline1.sc  gave the above error messages.   This was caused by my unicode encoding the
 UTF-8 not the result unicode strings.

 the wrong file is: fontlutline1.sc :
  .flash filename="fontoutline1.sc" version=6
    .font SimSun "SimSun.swf"
    .textshape helloworld font=SimSun size=200% text="DB2 \uE8B4\uADE7\u89A9\uE7AF\uAEE5\u8886\uE69E\u90"
    .filled filled_helloworld outline=helloworld fill=blue line=3 color=green
    .put filled_helloworld
.end


fontoutlinezh2.sc works.  It is:


.flash filename=" fontoutlinezh2.sc" version=6
    .font SimSun "SimSun.swf"
    .textshape helloworld font=SimSun size=200% text="Hello \u8D2D\u7269\u7BEE\u5206\u6790"
    .filled filled_helloworld outline=helloworld fill=blue line=3 color=green
    .put filled_helloworld
.end


Greetings

Matthias




reply via email to

[Prev in Thread] Current Thread [Next in Thread]