应该是用这个吧:
rawurlencode
(PHP 3, PHP 4 )rawurlencode -- URL-encode according to RFC 1738
Description
string rawurlencode ( string str)
Returns a string in which all non-alphanumeric characters except -_.
 
have been replaced with a percent (%) sign followed by two hex digits. This is the encoding described in RFC 1738 for protecting literal characters from being interpreted as special URL delimiters, and for protecting URL's from being mangled by transmission media with character conversions (like some email systems). For example, if you want to include a password in an FTP URL: 例子 1. rawurlencode() example 1echo '<a href="ftp://user:', rawurlencode('foo @+%/'),
     '@ftp.my.com/x.txt">';
 
 Or, if you pass information in a PATH_INFO component of the URL: 例子 2. rawurlencode() example 2echo '<a href="http://x.com/department_list_script/',
    rawurlencode('sales and eting/Miami'), '">';
 
 See also rawurldecode(), urldecode(), urlencode() and RFC 1738 很抱歉我不能帮你试, 因为事情多, 比较忙, sorry.

解决方案 »

  1.   

    不是这个。不是URL。
    是OpenLDAP中
    value为中文。要UTF-8
      

  2.   

    找到了几个方法(函数)。不能中英混用。
    还有UTF-8--》GB2312????
      

  3.   

    utf8_encode -- encodes an ISO-8859-1 string to UTF-8
    utf8_decode --  Converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte ISO-8859-1. string mb_convert_encoding ( string str, string to-encoding [, mixed from-encoding])
    mb_convert_encoding() converts character encoding of string str from from-encoding to to-encoding. 
    str : String to be converted. string iconv ( string in_charset, string out_charset, string str)
      

  4.   

    utf8_encode
    utf8_decode
    我用过。不行。他是8859-1,不是GB2312下面几个我没用过。是PHP的吗?
    glibc中的吧?
      

  5.   

    mbstring和iconv
    都不支持GB2312。