Re: How to set padding for base64 encoding

2016-04-07 Thread ag0aep6g via Digitalmars-d-learn
On 07.04.2016 14:57, rikki cattermole wrote: Ugh, 2.070.2 definitely has it still. I have no idea when that changed I don't think """...""" ever was a thing. You could definitely put newlines in normal "..." literals since basically forever. And concatenation of adjacent "..." literals

Re: How to set padding for base64 encoding

2016-04-07 Thread Suliman via Digitalmars-d-learn
On Thursday, 7 April 2016 at 12:43:54 UTC, rikki cattermole wrote: On 08/04/2016 12:39 AM, Suliman wrote: On Thursday, 7 April 2016 at 12:30:59 UTC, rikki cattermole wrote: On 08/04/2016 12:19 AM, Kagamin wrote: Create a range that would remove the newline characters from string, then decode

Re: How to set padding for base64 encoding

2016-04-07 Thread rikki cattermole via Digitalmars-d-learn
On 08/04/2016 12:52 AM, ag0aep6g wrote: On 07.04.2016 13:59, rikki cattermole wrote: "abc" strings are not multiline. Use """abc""" for that purpose. Wat. We're talking about, aren't we? In D, "abc" strings are multiline, and """abc""" is not a thing. `"""abc"""` is the same as `"" "abc" ""`

Re: How to set padding for base64 encoding

2016-04-07 Thread ag0aep6g via Digitalmars-d-learn
On 07.04.2016 13:59, rikki cattermole wrote: "abc" strings are not multiline. Use """abc""" for that purpose. Wat. We're talking about, aren't we? In D, "abc" strings are multiline, and """abc""" is not a thing. `"""abc"""` is the same as `"" "abc" ""` is the same as `"" ~ "abc" ~ ""` is the

Re: How to set padding for base64 encoding

2016-04-07 Thread rikki cattermole via Digitalmars-d-learn
On 08/04/2016 12:39 AM, Suliman wrote: On Thursday, 7 April 2016 at 12:30:59 UTC, rikki cattermole wrote: On 08/04/2016 12:19 AM, Kagamin wrote: Create a range that would remove the newline characters from string, then decode from that. Can confirm, its \n and \r that is causing the problems

Re: How to set padding for base64 encoding

2016-04-07 Thread Suliman via Digitalmars-d-learn
On Thursday, 7 April 2016 at 12:30:59 UTC, rikki cattermole wrote: On 08/04/2016 12:19 AM, Kagamin wrote: Create a range that would remove the newline characters from string, then decode from that. Can confirm, its \n and \r that is causing the problems here. with:

Re: How to set padding for base64 encoding

2016-04-07 Thread rikki cattermole via Digitalmars-d-learn
On 08/04/2016 12:19 AM, Kagamin wrote: Create a range that would remove the newline characters from string, then decode from that. Can confirm, its \n and \r that is causing the problems here.

Re: How to set padding for base64 encoding

2016-04-07 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 7 April 2016 at 12:24:06 UTC, Suliman wrote: On Thursday, 7 April 2016 at 12:19:48 UTC, Kagamin wrote: Create a range that would remove the newline characters from string, then decode from that. std.file.write("output.png", Base64.decode(myimg.chomp)); The same error Anyway if

Re: How to set padding for base64 encoding

2016-04-07 Thread Kagamin via Digitalmars-d-learn
chomp only trims the string at the beginning and at the end, not in the middle.

Re: How to set padding for base64 encoding

2016-04-07 Thread Suliman via Digitalmars-d-learn
On Thursday, 7 April 2016 at 12:19:48 UTC, Kagamin wrote: Create a range that would remove the newline characters from string, then decode from that. std.file.write("output.png", Base64.decode(myimg.chomp)); The same error

Re: How to set padding for base64 encoding

2016-04-07 Thread Kagamin via Digitalmars-d-learn
Create a range that would remove the newline characters from string, then decode from that.

Re: How to set padding for base64 encoding

2016-04-07 Thread Suliman via Digitalmars-d-learn
On Thursday, 7 April 2016 at 11:59:09 UTC, rikki cattermole wrote: On 07/04/2016 11:49 PM, Suliman wrote: It's look like my data have padding that cause crush on function: std.file.write("output.png", Base64.decode(myimg)); Invalid character: It's look like I should to use template

Re: How to set padding for base64 encoding

2016-04-07 Thread rikki cattermole via Digitalmars-d-learn
On 07/04/2016 11:49 PM, Suliman wrote: It's look like my data have padding that cause crush on function: std.file.write("output.png", Base64.decode(myimg)); Invalid character: It's look like I should to use template function, but I can't figure out how to use it. Could anybody show example?

How to set padding for base64 encoding

2016-04-07 Thread Suliman via Digitalmars-d-learn
It's look like my data have padding that cause crush on function: std.file.write("output.png", Base64.decode(myimg)); Invalid character: It's look like I should to use template function, but I can't figure out how to use it. Could anybody show example? My code: