Poco::Base64Decoder bug?

Please post support and help requests here.
Posts: 34
Joined: 03 Jul 2010, 12:26

Poco::Base64Decoder bug?

Postby sgsoft » 30 Nov 2013, 09:27

The string "select count(*) from devicestate" BASE64 encode is "c2VsZWN0IGNvdW50KCopIGZyb20gZGV2aWNlc3RhdGU=".

Code: Select all

std::string s("c2VsZWN0IGNvdW50KCopIGZyb20gZGV2aWNlc3RhdGU=");
      std::istringstream istr(s);
      Poco::Base64Decoder d(istr);
      std::string result;
      return 0;

above code will output "select". Maybe this is a bug?

POCO lib 1.4.6~ 1.5

Posts: 1268
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Poco::Base64Decoder bug?

Postby guenter » 30 Nov 2013, 11:35

This is not a base64 decoder bug. The >> stream extraction operator for std::string will stop reading at the first whitespace and thus is not suitable for reading strings containing whitespaces.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 4 guests