Results 1 to 7 of 7

Thread: Sending string from wowza to AS. Encoding problems

  1. #1
    Join Date
    Oct 2012
    Posts
    23

    Default Sending string from wowza to AS. Encoding problems

    Sending from wowza
    AMFDataObj marshalledObject = new AMFDataObj();
            marshalledObject.put("k1", 111);
            marshalledObject.put("k2", "Фёдор Петрович");
            marshalledObject.put("k3", "John Doe");
            client.call("doAction", null, "test", marshalledObject);
    Receiving in flash client
    public function doAction(method:String, obj:Object = null):void {
    	trace(method, obj);
    	if (method == "test") {
    		trace(obj.k1);
    		trace(obj.k2);
    		trace(obj.k3);
    	}
    }
    Reading trace logs from flashlog.txt
    test [object Object]
    111
    Фёдор Петрович
    John Doe
    Im shure that all source files have utf-8 encoding.
    In red5 server russiang strings passed without problems

  2. #2
    Join Date
    Oct 2012
    Posts
    23

    Default

    This string
    Фёдор Петрович
    is CP1252 representation of UTF-8 string
    Фёдор Петрович
    How to set AMDDataItem string encoding to UTF-8 instead of CP1252 ?

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Wowza is all utf-8. Make sure the Flash application and its HTTP container are too.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    ...
    Richard

  4. #4
    Join Date
    Oct 2012
    Posts
    23

    Default

    Im run flashh app in stand alone flash player.

    I tasted this
            AMFDataObj marshalledObject = new AMFDataObj();
            marshalledObject.put("k1", 111);
            String s = null;
            try {
                s = new String("Фёдор Петрович".getBytes(), "UTF-8");
            } catch (UnsupportedEncodingException e) {
            }
            marshalledObject.put("k2", "Фёдор Петрович");
            marshalledObject.put("k3", "John Doe");
            marshalledObject.put("k4", s);
            client.call("doAction", null, "test", marshalledObject);
    And get this logs from flash app
    k1= 111
    k2= Фёдор Петрович
    k3= John Doe
    k4= Фёдор Петрович

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    And the log file might not be supporting utf-8, but everything else might be.

    Richard

  6. #6
    Join Date
    Oct 2012
    Posts
    23

    Default

    I forgot "-encoding UTF8" key in ant task

  7. #7
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Cool, thanks for the update.

    Richard

Similar Threads

  1. mediacache problems character encoding
    By MARY2006 in forum Video On Demand Streaming Discussion
    Replies: 2
    Last Post: 02-13-2013, 03:12 PM
  2. How to parse whole url string that came to wowza
    By xzerth in forum Server-side Modules and Code Samples Discussion
    Replies: 4
    Last Post: 08-21-2012, 05:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •