June 04, 2016 Bast64URL Error; Invalid character | ||||
---|---|---|---|---|
| ||||
Hi! First, thank you to those who always answers. I got some DataURL string(it's png image) like this... ================================================================================ <img src="data:image/png;base64,iVBORw0KGgoAAAA... blah blah blah... example==" style="position: absolute; height: 100%; width: 100%;" height="1080" width="750"> ================================================================================ So, i used std.base64 library, and this is my test code. ================================================================================ import std.stdio; import std.base64; void main() { string data = "iVBORw0KGgoAAAA... blah blah blah... example=="; auto bin = Base64URL.decode( data ); File f = File("index.png", "wb"); f.rawWrite(bin); f.close(); } ================================================================================ And... get this error. ================================================================================ std.base64.Base64Exception@C:\D\dmd2\windows\bin\..\..\src\phobos\std\base64.d(1690): Invalid character: + ================================================================================ I tried finding "+" character, but i coudn't find it at original dataurl. What is my problem? Regards, |
June 04, 2016 Re: Bast64URL Error; Invalid character | ||||
---|---|---|---|---|
| ||||
Posted in reply to xky | On Saturday, 4 June 2016 at 15:27:53 UTC, xky wrote:
> Hi! First, thank you to those who always answers.
>
> I got some DataURL string(it's png image) like this...
> ================================================================================
> <img src="data:image/png;base64,iVBORw0KGgoAAAA... blah blah blah... example==" style="position: absolute; height: 100%; width: 100%;" height="1080" width="750">
> ================================================================================
>
> [...]
Oh, I make mistakes. "+" Character is in the data URL scheme. But the error is still.
Thanks.
|
Copyright © 1999-2021 by the D Language Foundation