         var length : Int = count(data)
         var lat = 0, lng = 0
         while index < length {
-            var b = 0
+            var b  = 0
             var shift = 0
             var result = 0
             
             do {
-                b = String(data[index++]).toInt()! - 63
+                //unicode value :( refactor
+                for char in data.charAt(index++).unicodeScalars {
+                    b = Int(char.value)
+                }
+                b -= 63
                 result |= (b & 0x1f) << shift
                 shift += 5
                 

import SwiftyJSON

extension String {
    subscript (i: Int) -> Character {
        return self[advance(self.startIndex, i)]
    }
}


            shift = 0;
            result = 0;
            do {
                //unicode value :( refactor
                for char in data.charAt(index++).unicodeScalars {
                    b = Int(char.value)
                }
                b -= 63
                result |= (b & 0x1f) << shift
                shift += 5
            } while (b >= 0x20);
