[swx] Foreign characters with swx

Nederflash (Folkert Hielema) info at nederflash.nl
Wed Dec 12 05:56:01 PST 2007


Isn't this depending on the charSet settings ? The current on the public 
  gateway doesn't like foreign characters. But i see this setting in 
amf.php so i don't know how this affects swx.php but it should be the 
same i hope/guess. Must do some test to know for sure.

Furtheron, i for one don't like data to be 'adjusted' on Server side. So 
the code used to fix the linebreaks is on client side (didn't notice any 
trouble sofar). But we should reconsider manipulating data, before it 
goes to the client.

my two cents,

Folkert
Aral Balkan wrote:
> Can some people affected by this issue please test Fabrício's code.
> 
> It would be great if we could get some test cases for this.
> 
> And I can include it in the next release once we're sure it's stable.
> 
> Thanks,
> Aral
> 
> On Dec 12, 2007 11:02 AM, Fabrício Seger Kolling <dulldusk at gmail.com 
> <mailto:dulldusk at gmail.com>> wrote:
> 
>     To get foreign characters working I utf8_encode all strings on the
>     function call result, before generating the swf file.
>     Here's the function that I added to swxCompiler.php
> 
>     function fixData($data){
>         // Assoc Array to Object
>         // UTF8 Encode Strings
>         // Fix Line Breaks
>         if (is_array($data)) {
>             reset($data);
>             $k = key($data);
>             if (strlen($k)==0){
>                 return $data;
>             } elseif ($k !== intval($k)) {
>                 $data = (object)$data;
>                 return $this->fixData($data);
>             } else {
>                 $d = Array();
>                 foreach ($data as $key => $val) {
>                     $d[$key] = $this->fixData($val);
>                 }
>                 return $d;
>             }
>         } elseif (is_object($data)) {
>             $d = new stdClass();
>             foreach ($data as $key => $val) {
>                 $d->{$key} = $this->fixData($val);
>             }
>             return $d;
>         } elseif (is_string($data)) {
>             return utf8_encode($this->fixLineBreaks($data));
>         } else {
>             return $data;
>         }
>     }
> 
>     function fixLineBreaks($str){
>         // Prevent CRLF from resulting 2 line breaks on Flash multiline
>     TextFields
>         // CRLF -> LF
>         // CR -> LF
>         if (strpos($str, chr(13)) !== false) {
>             $str = str_replace(chr(13), chr(10),
>     str_replace(chr(13).chr(10), chr(10), $str));
>         }
>         return $str;
>     }
> 
>     Fabrício Seger Kolling
> 
>     <mailto:fabricio at esmeril.com.br>
>     ben wrote:
>>     That sounds more like a Flash issue than a swx issue...
>>
>>     Some pointers
>>
>>     I don't know how you're "showing" the characters in your flash app
>>     (textfield?) but maybe the extended characters aren't embedded ?
>>
>>     If you "trace" the value, does it display correctly in the output
>>     window?
>>
>>     It's possible also that you might have to "encode" your string as
>>     unicode in php before sending it out for flash to recognise it.
>>
>>     Might be more of an Actionscript forum question altogether though...
>>
>>     Ben
>>
>>     Rune Høck Møller wrote:
>>>     Hi All,
>>>
>>>     I am having problem with showing foreign characters with swx.
>>>
>>>     My setup:
>>>
>>>     I get text into flash from a mysql with swx. 
>>>
>>>     I have embedded the specific characters needed ( danish
>>>     characters æøå ) in flash and tried with " System.useCodepage =
>>>     true; " but nothing works.
>>>
>>>     I have also tested my php script in the browser and it returns
>>>     the characters just fine.
>>>
>>>     My question is: 
>>>
>>>     Am I doing something wrong?
>>>
>>>     Is the swx not build for foreign languages?
>>>
>>>     Thanks in advance,
>>>
>>>     Rune
>>>
>>>     ------------------------------------------------------------------------
>>>
>>>     _______________________________________________
>>>     swx mailing list
>>>     swx at osflash.org <mailto:swx at osflash.org>
>>>     http://osflash.org/mailman/listinfo/swx_osflash.org
>>>       
>>
>>     ------------------------------------------------------------------------
>>
>>     _______________________________________________
>>     swx mailing list
>>     swx at osflash.org <mailto:swx at osflash.org>
>>     http://osflash.org/mailman/listinfo/swx_osflash.org
>>       
> 
>     _______________________________________________
>     swx mailing list
>     swx at osflash.org <mailto:swx at osflash.org>
>     http://osflash.org/mailman/listinfo/swx_osflash.org
>     <http://osflash.org/mailman/listinfo/swx_osflash.org>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org
> 
> 
> ------------------------------------------------------------------------
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.17.1/1181 - Release Date: 11-12-2007 17:05




More information about the swx mailing list