Your translate reader works really well, thanks for sharing it.

I have seen code that tried to decode base64 four times in the wild, which 
led me to posting this, hope something like this could be incorporated into 
the standard library. 

On Tuesday, February 2, 2021 at 8:50:08 PM UTC+8 rog wrote:

> In case you find it helpful, here's a clone of the base64 command that I 
> wrote in Go. I did it precisely because I wanted to be able to decode any 
> encoding scheme interchangeably.
>
> https://github.com/rogpeppe/misc/blob/master/cmd/base64/base64.go
>
> I agree that it might be useful to have some of this functionality 
> available in the standard library.
>
>   cheers,
>     rog.
>
> On Tue, 2 Feb 2021 at 09:08, hey...@gmail.com <hey...@gmail.com> wrote:
>
>> Hi,
>>
>> I have an io.Reader whose content is encoded in base64 with encoding type 
>> unknown. Since there shouldn't be any ambiguity between the two, is it 
>> possible to make the base64 automatically pick the right one to decode?
>>
>> Currently I have to read everything out to pin down the encoding, which 
>> defeats the purpose of using an io.Reader.
>>
>> Is there a solution to this problem?
>>
>> Thanks in advance.
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/0ccee37d-319e-41b3-9bfd-3dc46e0fad78n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/0ccee37d-319e-41b3-9bfd-3dc46e0fad78n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/15c0911e-cf08-48e2-b979-054ee7525d97n%40googlegroups.com.

Reply via email to