Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Pre-sales

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-06-2005, 09:52 PM
Junior Member
 
Join Date: Oct 2005
Posts: 2
Default UTF Support...

I know of flash problem with UTF 8 support for input fields, - I have downloaded Your example of "save text file" and it doesn't catch characters... I know there's a workaround in flash with listening to keypresses but - is there a way you will solve this in future releases ? I need to know!

I have previously downloaded Your software - a year or so and I haven't downloaded new version yet for testing but I am interested now in buying swf2exe software since I need it for upcoming multimedia projects.

Thank You in advance...
Reply With Quote
  #2 (permalink)  
Old 10-07-2005, 02:42 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:UTF Support...

Do you mean that you want to save some special charactors into a text file?
Reply With Quote
  #3 (permalink)  
Old 10-07-2005, 06:01 PM
Junior Member
 
Join Date: Oct 2005
Posts: 2
Default Re:UTF Support...

Yes.
That's what I always wanted to have in flash. For example: Dutch, French, Hungarian etc. language specific characters. When You're developing Win platform app for large number of users that's what You need desperately... I have downloaded trial but hadn't got much time to learn more about your scripting language. Just a touch of it and I like the output very much - it's a light weight application... well.. Do You have any idea about language input ?
Reply With Quote
  #4 (permalink)  
Old 10-10-2005, 02:44 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:UTF Support...

Code:
function toUTF8(string)
{
var i;
var stream = new StringStream;

for (i = 0; i < string.length; i++)
{
var code = string.charCodeAt(i);

if (code < (1 << 7))
{
stream.put(code);
}
else if (code < (1 << 11))
{
stream.put((code >> 6) | 0xC0);
stream.put((code & 0x3F) | 0x80);
}
else if (code < (1 << 16))
{
stream.put(0xE0 | ((code >> 12) & 0x0F));
stream.put(0x80 | ((code >> 6) & 0x3F));
stream.put(0x80 | (code & 0x3F));
}
else if (code < (1 << 21))
{
stream.put((code >> 18) | 0xe0);
stream.put(((code >> 12) & 0x3f) | 0x80);
stream.put(((code >> 6) & 0x3f) | 0x80);
stream.put((code & 0x3f) | 0x80);
}
}

return stream;
}

var str = '<project name="test" default="init" basedir=".">' +
'     <target name="init">' +
'          <!-- displays Hello in Chinese -->' +
'          <echo message="The chinese word is: 世纪"/>' +
'     </target>' +
'</project>';

var f = new FileStream("c:\\1.xml", "w");
f.writeLine('<?xml version="1.0" encoding="UTF-8"?>');
f.write(toUTF8(str));
f.close();
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:15 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.