[prev in list] [next in list] [prev in thread] [next in thread] 

List:       swftools-common
Subject:    [Swftools-common] Re: your response on DBCS and SWF / UTF-8
From:       "Bill Hall" <wrh099 () gmail ! com>
Date:       2006-08-13 14:54:24
Message-ID: efdee1740608130754l6b7bda4bve4dd4e684207dfff () mail ! gmail ! com
[Download RAW message or body]

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
>
>
>

[Attachment #3 (text/html)]

<span id="_user_kramm@quiss.org">Matthias,<br><br>&nbsp;Thanks for the answers. They \
help!<br></span><br><div><span class="gmail_quote"></span><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <br>1.) swfc will accept UTF-8 encoded files, but \
only without a DOM.<br>&nbsp;&nbsp;&nbsp;&nbsp;That could be considered a bug, so I'm \
putting this on my TODO list.<br>&nbsp;&nbsp;&nbsp;&nbsp;Could you please send me one \
of your test files (one of the ones<br> &nbsp;&nbsp;&nbsp;&nbsp;with a DOM at the \
start?)</blockquote><div><br><br>I'll send a file&nbsp; that includes the BOM (byte \
order mark) for UTF-8 on the front.<br>Yes I tried it and it works without the BOM. \
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> 2.) swfc uses the \
Actionscript compiler von the Ming Flash library.<br>&nbsp;&nbsp;&nbsp;&nbsp;While \
normal swfc syntax (e.g. textshape) support's both UTF-8 \
input<br>&nbsp;&nbsp;&nbsp;&nbsp;and escaped Unicode (\uxxxx), I'm not sure about the \
Actionscript<br>&nbsp;&nbsp;&nbsp;&nbsp;compiler. (Anything between the .action: and \
the .end is processed <br>&nbsp;&nbsp;&nbsp;&nbsp;by a different lexer and \
grammar)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;What would probably work (didn't try it) is \
to escape not the<br>&nbsp;&nbsp;&nbsp;&nbsp;Unicode, but the \
UTF-8:<br>&nbsp;&nbsp;&nbsp;&nbsp;Instead \
of<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.titled = \
&quot;DB2 \u8D2D\u7269\u7BEE\u5206\u6790&quot; \
<br>&nbsp;&nbsp;&nbsp;&nbsp;write<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.titled \
= &quot;DB2 \xe2\xb6\x8d\xe6\xa5\xb2\xee\xb9\xbb\xd9\x92\xe9\x81\xa7&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;with \
the latter being the byte-encoded UTF8 version of the \
UTF16<br>&nbsp;&nbsp;&nbsp;&nbsp;data of the original line. \
</blockquote><div><br>2A.<br>&nbsp;Actually, if I did this test&nbsp; correctly , it \
didn't compile.<br><br>This file:<br>.flash name=&quot;variablezh1x.swf&quot; \
version=6<br>&nbsp;&nbsp;&nbsp; \
.action:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.controls.frameRate = \
15;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Controls.titled = &quot;DB2 \
\xe2\xb6\x8d\xe6\xa5\xb2\xee\xb9\xbb\xd9\x92\xe9\x81\xa7&quot;<br>&nbsp;&nbsp;&nbsp; \
.end<br>.end<br><br>gave Error \
messages:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Controls.titled = \
&quot;DB2 \xe2\xb6\x8d\xe6\xa5\xb2\xee\xb9\xbb\xd9\x9 \
<br>\xe9\x81\xa7&quot;<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>warning:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br><br>Line 0005:&nbsp; Reason: 'unsupported escape sequence'<br>warning:<br>Line \
0005:&nbsp; Reason: 'unsupported escape sequence'<br>error:<br>Line 7: Reason: \
'Unexpected EOF found while looking for input.' <br>&quot;<a \
href="http://variablezh1x.sc">variablezh1x.sc</a>&quot;, line 2 column 12: error- \
Couldn't compile ActionScript<br><br>2B.<br>&nbsp;the original unicode escaped file \
gives warning messages, I assume this was due to the font issues <br>but seems to \
compile.&nbsp; Is the data there?&nbsp; It seems to be via a swfdump but maybe I \
misunderstand.<br><br>i.e. <br>.flash name=&quot;variablezh1.swf&quot; \
version=6<br>&nbsp;&nbsp;&nbsp; \
.action:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.controls.frameRate = 15; \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Controls.titled = &quot;DB2 \
\uE8B4\uADE7\u89A9\uE7AF\uAEE5\u8886\uE69E\u90&quot;;<br>&nbsp;&nbsp;&nbsp; \
.end<br>.end<br><br>gives \
warning.<br><br>warning:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
this.Controls.titled = &quot;DB2 \uE8B4\uADE7\u89A9\uE7AF\uAEE5\u8886\u \
<br>90&quot;<br><br><br>&nbsp; ^<br>warning:<br><br>&nbsp; ^<br><br>Line 0005:&nbsp; \
Reason: 'unsupported escape sequence'<br>warning:<br>Line 0005:&nbsp; Reason: \
'unsupported escape sequence'<br>&quot;<a href="http://variablezh1.sc">variablezh1.sc \
</a>&quot;, line 6 column 1: warning- Empty bounding box for movie<br><br>seems to \
compile with warnings.<br></div><br><blockquote class="gmail_quote" \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;"> 3.) The problem you wrote in the other \
mail:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;C:\PlayerIn\sc&gt;c:\swftools\swfc <a \
href="http://fontoutline1.sc">fontoutline1.sc</a> -o \
font-zh1.swf<br>&nbsp;&nbsp;&nbsp;&nbsp;No char 59572 in font \
SimSun<br>&nbsp;&nbsp;&nbsp;&nbsp;No char 44519 in font SimSun \
<br>&nbsp;&nbsp;&nbsp;&nbsp;No char 59311 in font \
SimSun<br>&nbsp;&nbsp;&nbsp;&nbsp;No char 44773 in font \
SimSun<br>&nbsp;&nbsp;&nbsp;&nbsp;No char 59038 in font \
SimSun<br>&nbsp;&nbsp;&nbsp;&nbsp;No char 144 in font \
SimSun<br><br>&nbsp;&nbsp;&nbsp;&nbsp;suggests that the UTF8 encoding itself worked \
(59572 = \xe8b4), but <br>&nbsp;&nbsp;&nbsp;&nbsp;there was a problem in the \
font.<br>&nbsp;&nbsp;&nbsp;&nbsp;Could you send me both the SimSun.ttf file as well \
as the converted<br>&nbsp;&nbsp;&nbsp;&nbsp;font (SimSun.swf)? \
Thanks!</blockquote><div><br><br>&nbsp;I'll send the files but I resolved this \
issue&nbsp; (I think). <br>&nbsp;<a \
href="http://fontoutline1.sc">fontoutline1.sc</a>&nbsp; gave the above error \
messages.&nbsp;&nbsp; This was caused by my unicode encoding the<br>&nbsp;UTF-8 not \
the result unicode strings.<br><br>&nbsp;the wrong file is: <a \
href="http://fontlutline1.sc"> fontlutline1.sc</a> :<br>&nbsp; .flash \
filename=&quot;<a href="http://fontoutline1.sc">fontoutline1.sc</a>&quot; \
version=6<br>&nbsp;&nbsp;&nbsp; .font SimSun \
&quot;SimSun.swf&quot;<br>&nbsp;&nbsp;&nbsp; .textshape helloworld font=SimSun \
size=200% text=&quot;DB2 \uE8B4\uADE7\u89A9\uE7AF\uAEE5\u8886\uE69E\u90&quot; \
<br>&nbsp;&nbsp;&nbsp; .filled filled_helloworld outline=helloworld fill=blue line=3 \
color=green<br>&nbsp;&nbsp;&nbsp; .put filled_helloworld<br>.end<br><br><br><a \
href="http://fontoutlinezh2.sc">fontoutlinezh2.sc</a> works.&nbsp; It \
is:<br><br><br>.flash filename=&quot; <a \
href="http://fontoutlinezh2.sc">fontoutlinezh2.sc</a>&quot; \
version=6<br>&nbsp;&nbsp;&nbsp; .font SimSun \
&quot;SimSun.swf&quot;<br>&nbsp;&nbsp;&nbsp; .textshape helloworld font=SimSun \
size=200% text=&quot;Hello \u8D2D\u7269\u7BEE\u5206\u6790&quot;<br> \
&nbsp;&nbsp;&nbsp; .filled filled_helloworld outline=helloworld fill=blue line=3 \
color=green<br>&nbsp;&nbsp;&nbsp; .put \
filled_helloworld<br>.end<br><br></div><br><blockquote class="gmail_quote" \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;"> Greetings<br><br>Matthias<br><br><br></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic