includes/json2.php
changeset 890 b624c55ab771
parent 880 218b6d4de908
child 1010 12e76b1acb4e
equal deleted inserted replaced
889:7e933a5c860b 890:b624c55ab771
   773                             case '\'' :
   773                             case '\'' :
   774                                 $result .= '\'';
   774                                 $result .= '\'';
   775                                 break;
   775                                 break;
   776                             case 'u':
   776                             case 'u':
   777                               $result .= self::decode_unicode_byte(substr($str, $i + 1, 4));
   777                               $result .= self::decode_unicode_byte(substr($str, $i + 1, 4));
       
   778                               $i += 4;
   778                               break;
   779                               break;
   779                             default:
   780                             default:
   780                                 throw new Zend_Json_Exception("Illegal escape "
   781                                 throw new Zend_Json_Exception("Illegal escape "
   781                                     .  "sequence '" . $chr . "'");
   782                                     .  "sequence '" . $chr . "'");
   782                             }
   783                             }
   939         $character =
   940         $character =
   940             chr((($value & 0xf000) >> 12) | 0xe0)
   941             chr((($value & 0xf000) >> 12) | 0xe0)
   941           . chr((($value & 0x0fc0) >> 6) | 0x80)
   942           . chr((($value & 0x0fc0) >> 6) | 0x80)
   942           . chr(($value & 0x3f) | 0x80);
   943           . chr(($value & 0x3f) | 0x80);
   943       }
   944       }
       
   945       
       
   946       return $character;
   944     }
   947     }
   945 }
   948 }
   946 
   949 
   947 /**
   950 /**
   948  * Zend Framework
   951  * Zend Framework