  | |  | String.length in utf-8 script | String.length in utf-8 script 2004-02-17 - By Kostas Chatzikokolakis
Back Hello, I develop a flashcom application in greek language. Since flashcom sends all data in unicode I converted a script file with greek strings in utf-8, as suggested in the documentation. Strings are displayed perfectly with trace() in both client and server, however the String.length property gives an incorrect value.
I attach a minimal utf-8 encoded main.asc script to demonstrate the problem. It creates a string "A" (the 'A' in greek language) and traces the string and its length. The string is printed perfectly but length gives 2 instead of 1. This is problably due to the fact that 'A' is a double-byte chatacter, using a latin "a" it gives 1! Escaped characters ("\uXXXX") also work fine. Finally, #include-ing the same file in a .fla file also gives correct results!
Has anyone ever encountered this problem? Am I doing something wrong? Is there a workaround? Thanks a lot in advance.
Kostas Chatzikokolakis
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: flashcomm-unsubscribe@(protected) For additional commands, e-mail: flashcomm-help@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |