2015-09-05 99 views
0

base64Decode()正在返回0.它没有给出正确的输出。这是我的代码:如何从base64decode获取base64字符串的长度?

std::string source="iVBORw0KGgoAAA/j7.."; 
int len = 0; 
unsigned char *buffer; 
len = base64Decode((unsigned char*)source.c_str(), (unsigned int)source.length(), &buffer); 
+0

先生,我不明白你说什么.. –

+0

可能重复的[为什么base64Decode是不返回字符串的长度?](http://stackoverflow.com/questions/32409734/why- base64decode - 是 - 不回 - lenth-的字符串) –

回答

0

“\”不包含在Base64中。 添加一个严格的参数,检查您的字符串是否包含base64范围之外的字符。 发布你的结果后:)