pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:2137:    p_wchar2 c = index_shared_string(in,i);    if( (c < 0 || c > 0x10ffff) || (c>0xd7ff && c<0xe000) )    string_builder_append( &out, repl_char, 1 );    else    string_builder_putchar( &out, c );    }    push_string( finish_string_builder( &out ) );    }   }    - /*! @decl string(0..255) string_to_utf8(string s) -  *! @decl string(0..255) string_to_utf8(string s, int extended) + /*! @decl utf8_string string_to_utf8(string s) +  *! @decl utf8_string string_to_utf8(string s, int extended)    *!    *! Converts a string into an UTF-8 compliant byte-stream.    *!    *! @note    *! Throws an error if characters not valid in an UTF-8 stream are    *! encountered. Valid characters are in the ranges    *! @expr{0x00000000-0x0000d7ff@} and @expr{0x0000e000-0x0010ffff@}.    *!    *! If @[extended] is 1 then characters outside the valid ranges are    *! accepted too and encoded using the same algorithm. Such encoded
pike.git/src/builtin_functions.c:2283: Inside #if defined(PIKE_DEBUG)
   if (len != dst - STR0(out)) {    Pike_fatal("string_to_utf8(): Calculated and actual lengths differ: "    "%"PRINTPTRDIFFT"d != %"PRINTPTRDIFFT"d\n", len, dst - STR0(out));    }   #endif /* PIKE_DEBUG */    out = end_shared_string(out);    pop_n_elems(args);    push_string(out);   }    - /*! @decl string utf8_to_string(string(0..255) s) -  *! @decl string utf8_to_string(string(0..255) s, int extended) + /*! @decl string utf8_to_string(utf8_string s) +  *! @decl string utf8_to_string(utf8_string s, int extended)    *!    *! Converts an UTF-8 byte-stream into a string.    *!    *! @param s    *! String of UTF-8 encoded data to decode.    *!    *! @param extended    *! Bitmask with extension options.    *! @int    *! @value 1
pike.git/src/builtin_functions.c:9835:    /* Some Wide-string stuff */       /* function(string,int(0..2)|void:string(0..255)) */    ADD_EFUN("string_to_unicode", f_string_to_unicode,    tFunc(tStr tOr(tInt02,tVoid),tStr8), OPT_TRY_OPTIMIZE);       /* function(string(0..255),int(0..2)|void:string) */    ADD_EFUN("unicode_to_string", f_unicode_to_string,    tFunc(tStr8 tOr(tInt02,tVoid),tStr), OPT_TRY_OPTIMIZE);    -  /* function(string,int|void:string(0..255)) */ +  /* function(string,int|void:utf8_string) */    ADD_EFUN("string_to_utf8", f_string_to_utf8, -  tFunc(tStr tOr(tInt,tVoid),tStr8), OPT_TRY_OPTIMIZE); +  tFunc(tStr tOr(tInt,tVoid),tUtf8Str), OPT_TRY_OPTIMIZE);       ADD_EFUN("string_filter_non_unicode", f_string_filter_non_unicode,    tFunc(tStr tOr(tInt,tVoid),tStr8), OPT_TRY_OPTIMIZE);    -  /* function(string(0..255),int|void:string) */ +  /* function(utf8_string,int|void:string) */    ADD_EFUN("utf8_to_string", f_utf8_to_string, -  tFunc(tStr8 tOr(tInt,tVoid),tStr), OPT_TRY_OPTIMIZE); +  tFunc(tUtf8Str tOr(tInt,tVoid),tStr), OPT_TRY_OPTIMIZE);          ADD_EFUN("__parse_pike_type", f_parse_pike_type,    tFunc(tStr8,tStr8),OPT_TRY_OPTIMIZE);       ADD_EFUN("__soft_cast", f___soft_cast,    tFunc(tSetvar(0, tType(tMix)) tSetvar(1, tType(tMix)),    tAnd(tVar(0), tVar(1))),    OPT_TRY_OPTIMIZE);