Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 839081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:24:33+00:00 2026-05-15T05:24:33+00:00

AS3 documentation says that Strings in AS3 are in UTF-16 format. There is a

  • 0

AS3 documentation says that Strings in AS3 are in UTF-16 format.

There is a textbox on a Flash Clip where user can type some data.

When a button is clicked, I want this data to be sent to a php script.

I have everything set up, but it seems that the PHP script gets the data in UTF-16 format. The data in the database (which is utf-8) shows some unrecognizable characters (where special characters are used), meaning that the data has not been sent in a correct encoding.

var variables:URLVariables=new URLVariables;

var varSend:URLRequest=new URLRequest("http://website.com/systematic/accept.php");
varSend.method=URLRequestMethod.POST;
varSend.data=variables;

var varLoader:URLLoader=new URLLoader;
varLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);

When submit button is clicked, the following handler gets executed.

function sendData(event:MouseEvent) : void {
    // i guess here is the problem (tbName.text is UTF-16)
    variables.name = tbName.text;

    varLoader.load(varSend);
}

Is there any way to send the data so that PHP script gets the data in UTF-8 format?

(PHP script is retrieving the value using the $_POST[‘name’]).


EDIT (after useful comments):

I’ve tried to convert the POST variable to UTF-8 by using iconv() but I get only question marks. That may mean that I was wrong in assuming the php got the string in a UTF-16 format. It seems not. But now I have absolutely no idea how to fix this.

The characters in question are croatian characters (č, ć, š, ž and đ), all are in Windows-1250 encoding. If I manually edit the entry in phpMyAdmin and enter any of those characters, everything works great. But if I am doing it thru flash, it doesn’t work.

Another strange thing, I have removed iconv and put everything like it was in the beginning and now only non-special characters get shown up to first croatian. For example, if I write “ačasdfadfa”, only the “a” gets stored int the database.


Another edit:

I have now tried to switch the croatian characters into something ASCII (see the code below) and then return them to č, ć, etc. on the PHP side. Flash obviously forwards this right (since there’s no special characters anymore), but the PHP does not correctly convert the chars back to the string. This is what I was doing.

http://pastebin.com/qjVcrNuV

so I guess it’s something with PHP or how it stores the data into the database. The PHP file itself is UTF-8 encoded.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:24:34+00:00Added an answer on May 15, 2026 at 5:24 am

    Update:

    If it’s indeed UTF-16 data you are getting from Flash, you could as a quick fix try converting the input in PHP:

    $name = iconv("UTF-16", "UTF-8", $_POST["name"]); 
    

    you could try that and check whether the data looks okay then.
    however, if at all possible, I would say it would be preferable to get Flash to send UTF-8 data.

    Old answer:

    <speculation>

    This doesn’t sound like UTF-16 to me but more like UTF-8 data being displayed in an ISO-8859-1 encoded environment. Where are you outputting the variables? Is the page you are doing the output on encoded in UTF-8 as well? (See the browser’s “encoding” menu) If I had to bet, I would say Flash is transmitting them correctly as UTF-8, but the problem is on the
    output end.

    </speculation>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't seem to find any GUI framework's for as3 that are as good
Okay getting some weirdness. I have a simple URLLoader in AS3 that loads an
Make a new AS3 Document in Flash, paste in the following code and run
I am using AS3 to create a tween affect between multiple images that have
I'm using AS3 (Flash) to read SVG files and display them. The problem is
I've got an AS3 SWF that I'm going to be loading other SWFs into.
I'd like to know if Flash/AS3 has any nice way to convert an AS3
AS3 Code: import flash.utils.Dictionary; var num1:Number = Number.NaN; var num2:Number = Math.sqrt(-1); var dic:Dictionary
In AS3 you can pass a constant to the compiler -define+=CONFIG::DEBUG,true And use it
after browsing the documentation for the sound classes, it seems there is no way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.