public static function load($value)
  {
    $value = trim($value);

    if (0 == strlen($value)) {
      return '';
    }

    if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
      $mbEncoding = mb_internal_encoding();
      mb_internal_encoding('ASCII');
    }

    switch ($value[0]) {
      case '[':
        $result = self::parseSequence($value);
        break;
      case '{':
        $result = self::parseMapping($value);
        break;
      default:
        $result = self::parseScalar($value);
    }

    if (isset($mbEncoding)) {
      mb_internal_encoding($mbEncoding);
    }

    return $result;
  }