1. The forum you are viewing relates to Kayako 3, which reached end of life in 2012. Please be aware that a lot of information relating to features, sales and the roadmap in the Kayako 3 forums is now outdated or defunct (i.e. plain wrong!).

    If unsure about anything, please create a new thread or contact us.

    You can visit the main forums for the latest Kayako here.

UTF-8 and UTF-16

Discussion in 'Kayako InstaAlert, SyncWorks and KayakoMobile' started by craigbrass, Mar 28, 2010.

  1. craigbrass

    craigbrass New Member

    A client of ours using our BlackBerry Ticket Client contacted us to say that sync suddenly stopped working. Another client then contacted us to say the same thing.

    It took a while but we finally nailed down the issue. It was down to the character Ascii Table being in one of the ticket replies.

    The developer of this application spent a while trying to fix the issue on the BlackBerry but didn't get very far. Both of the parsers we tried to use just point blank refused to do anything once it hit the bad character. One thing we tried was scanning the XML file and removing bad characters first but this took 30 minutes to do so was not an option.

    I passed this over to one of my PHP developers and he found the ultimate problem is the following lines of Kayako code in /includes/functions_xml.php :-
    Code:
    	/**
    	* Function to be called before XML building starts
    	*/
    	function buildXML($charset)
    	{
    		global $_SWIFT;
    
    		if (SWIFT_AREA == SWIFT_MOBILE)
    		{
    			$this->charset = "UTF-16";
    		} else {
    			$this->charset = $charset;
    		}
    
    		$this->xmldata = array();
    		$this->xmldata[] = '<?xml version="1.0" encoding="'. $this->charset .'"?>'.$this->crlf;
    
    		return true;
    	}
    For some reason (my developer has no idea why it has been coded this when UTF-8 works much better), it has been set to use UTF-16 for all mobile devices. The problem, however, is it is putting characters in UTF-8 format (such as the one I listed above) into the UTF-16 output.

    This really needs to get resolved and I hope it can be patched in the next minor build.
     
  2. craigbrass

    craigbrass New Member

  3. Ryan Lederman

    Ryan Lederman Kayako Guru

    There is only one reason that the string "UTF-16" is used here: this was before the KayakoMobile API was opened to the public, and the MSXML library we were using on Windows Mobile refused to parse the XML unless the header said UTF-16.

    The encoding of the actual data remains to be UTF-8.
     
  4. craigbrass

    craigbrass New Member

    Well we have done some more testing and it is just my second post that I need resolving to be able to get our application working. We need characters 0-31 from ASCII Table - ASCII and Unicode Characters stripped before data gets sent out. There is NO way around this locally on the BlackBerry due to the parser.

    I would appreciate getting this resolved before the next build.
     
  5. craigbrass

    craigbrass New Member

    Bump. I want to make sure this makes the next release...
     
  6. craigbrass

    craigbrass New Member

    Bump. Had another user who had problems with this today again having to provide them with a patched file to remove those characters. Please can we get this resolved?
     
  7. Jamie Edwards

    Jamie Edwards Chief Limey Staff Member

  8. craigbrass

    craigbrass New Member

    Great stuff. I take it this is planned for 3.70.03 and in which case, when is this due out?
     
  9. Jamie Edwards

    Jamie Edwards Chief Limey Staff Member

    Most likely, yes
     

Share This Page