Detecting the default encoding used by the host operating system in Adobe AIR

by Peter deHaan on December 25, 2008 · 0 comments

in File

The following example shows how you can detect the default encoding used by the host operating system by using the static File.systemCharset property.

Full code after the jump.

<?xml version="1.0" encoding="utf-8"?>
<!-- http://airexamples.com/2008/12/25/detecting-the-default-encoding-used-by-the-host-operating-system-in-adobe-air/ -->
<mx:WindowedApplication name="File_systemCharset_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        height="200">
 
    <mx:VBox>
        <mx:Label text="File.systemCharset:" />
        <mx:Label text="{File.systemCharset}"
                selectable="true"
                fontSize="48" />
    </mx:VBox>
 
</mx:WindowedApplication>

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post:

Next post: