亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 大家來看看這個采用的什么編碼方式 [打印本頁]

作者: 2004123201    時間: 2010-07-12 10:05
標(biāo)題: 大家來看看這個采用的什么編碼方式
%25u600E%25u4E48%25u6355%25u7684%25uFF1F
我想將這些轉(zhuǎn)化為UTF8,可是不知道這是什么編碼方式,往各位大俠指點(diǎn)下
作者: llslls_007    時間: 2010-07-12 10:50
%25  把%輸出轉(zhuǎn)義的話  25看成16進(jìn)制的話  翻譯成字符串 %u600E%u4E48%u6355%u7684%uFF1F   


把%u看成utf16編碼的分隔符 可以翻譯成中文:怎么捕的?
作者: 2004123201    時間: 2010-07-12 11:02
多謝!解析的很正確
作者: 2004123201    時間: 2010-07-12 11:29
如果要把這個轉(zhuǎn)成UTF8,有現(xiàn)成的函數(shù)沒?
作者: llslls_007    時間: 2010-07-12 11:44
回復(fù) 4# 2004123201

百度,然后ctrl c  and  ctrl v
作者: 沒本    時間: 2010-07-12 11:53
編碼本身不保證是UTF-8的,有可能是UNICODE其他字節(jié)長度或者GBK或者其他本地編碼,可以用libcurl先解碼,如果需要本地編碼轉(zhuǎn)UTF-8用iconv庫函數(shù)。

NAME

curl_easy_unescape - URL decodes the given string

SYNOPSIS

#include <curl/curl.h>

char *curl_easy_unescape( CURL * curl , char * url , int inlength , int * outlength );


DESCRIPTION

This function converts the given URL encoded input string to a "plain string" and returns that in an allocated memory area. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to their binary versions.

If the length argument is set to 0 (zero), curl_easy_unescape(3) will use strlen() on the input url string to find out the size.

If outlength is non-NULL, the function will write the length of the returned string in the integer it points to. This allows an escaped string containing %00 to still get used properly after unescaping.

You must curl_free(3) the returned string when you're done with it.

AVAILABILITY

Added in 7.15.4 and replaces the old curl_unescape(3) function.

RETURN VALUE

A pointer to a zero terminated string or NULL if it failed.
作者: rain_fish    時間: 2010-07-12 16:06
%25  把%輸出轉(zhuǎn)義的話  25看成16進(jìn)制的話  翻譯成字符串 %u600E%u4E48%u6355%u7684%uFF1F   


把%u看成 ...
llslls_007 發(fā)表于 2010-07-12 10:50


強(qiáng)悍!
作者: 2004123201    時間: 2010-07-12 21:14
%25  把%輸出轉(zhuǎn)義的話  25看成16進(jìn)制的話  翻譯成字符串 %u600E%u4E48%u6355%u7684%uFF1F   


把%u看成 ...
llslls_007 發(fā)表于 2010-07-12 10:50



    我試了這個方法,把分割后的編碼用iconv從utf16轉(zhuǎn)到utf8。全是亂碼,這是怎么回事呢?你是怎么解碼的?能說下么
作者: daniel_kohler    時間: 2010-07-13 09:55
回復(fù) 1# 2004123201


    URL編碼!
作者: 2004123201    時間: 2010-07-13 10:18
回復(fù) 9# daniel_kohler


    先用URL解碼 再用UTF16轉(zhuǎn)utf8 還是不行
作者: llslls_007    時間: 2010-07-13 10:29
回復(fù) 8# 2004123201


    我沒有轉(zhuǎn)換成utf8 ,而是根據(jù)unicode碼 找到對應(yīng)的gb碼解出中文

   unicode 碼: utf 16到 utf8  的轉(zhuǎn)換 ,先看原理,了解utf16編碼怎么用2字節(jié)表示,再了解怎么用這2字節(jié)轉(zhuǎn)換3字節(jié)表示,這就變成了
                utf8的表示方式,網(wǎng)上有大把實(shí)現(xiàn)
作者: 2004123201    時間: 2010-07-13 10:37
回復(fù) 11# llslls_007


    恩,多謝了  我去看下




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2