Max Titov IV @ TechSplice

The most beautiful music of all is the music of what happens.
  • Home
  • About
9 Dec 2007

Cyrilic integration of Flex and PHP

A recent project involved integration between a PHP content management tool like Joomla and Adobe Flex 2. I wrote a PHP script that parsed a MySQL database creating an XML structure that was then picked up by a HTTPService in a Flex application.

The information in the database was stored in Cyrillic format, hence when ever I was loading the data in to the SWF compiled file the end result was a collection of garbage data.  Setting the actuall HTML to Windows-1251 encoding did not help the situation.

My following approach was to locate a native functionality within the Flex architecture to mediate the situation.  Unforchunately I wasn’t successful in aquiring sattisfying examples to solve the problem.  For that matter it became sadly obvious that I haven’t seen any flash pages using non/english alphabet [either I haven't been checking international sites that much or Adobe Flex isn't widely used overseas] .

My third approach was to look at the actual php code that was generating the XML structure.  I’ve discovered a useful function mb_convert_encoding that eventually solved my problems.  Using a simple snippet of code:

mb_convert_encoding($string_to_convert,'UTF-8','Windows-1251');

I was able to convert the data from UTF-8 in to Windows-1251 which allowed me to display the desired Cyrillic characters.

Tags: code, development, flash, Flex, php, sql

This entry was posted on Sunday, December 9th, 2007 at 7:57 pm and is filed under Flex, Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Cyrilic integration of Flex and PHP”

  1. Alexey says:
    August 27, 2009 at 7:39 am

    Can you tell me where to put this line,
    mb_convert_encoding($string_to_convert,’UTF-8′,’Windows-1251′);
    and to which file?

  2. Max says:
    August 27, 2009 at 8:33 am

    Hi Alex,

    Use the function to convert a string to a desired format [it's standard].

    That’s about all that I can say given the information that you’ve provided me.

    Best regards,

Leave a Reply

Click here to cancel reply.

You must be logged in to post a comment.

« Hacking CSS
Workaround for: “Click to activate and use this control” IE problem. »
  • Subscribe using FeedBurner
  • Cloud Data

    abap adobe animation basic beautiful builder camera code configuration contribution design development digital engineering fix flash Flex function images interesting lesson new paypal Photography php problem problems program programmer programming review sap SAP/ABAP sdk setup soap software solution story system tables transaction transports user video

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

  • My Links

    • Cooking
    • Gallery
    • Resume
  • Online Tools

    • Airline Ticket Search
    • Estimate Shipping Cost [from US]
    • Link your Blog
  • Software Engineering Blogs

    • Adam Goucher
    • Joel on Software
    • The Third Bit
    • Wide Awake Developers
  • Categories

    • Everyday stuff
    • Flex
    • Photography
    • SAP/ABAP
    • Short Stories
    • Software Engineering
    • Web Development
  • Gallery

    Roy Tanck's Flickr Widget requires Flash Player 9 or better.

Max Titov IV @ TechSplice is proudly powered by WordPress
Design & code by Jonk
Entries (RSS) and Comments (RSS).