How to convert string to base64 byte array, would this be valid?

后端 未结 5 2045
温柔的废话
温柔的废话 2021-02-03 20:20

I\'m trying to write a function that converts a string to a base64 byte array. I\'ve tried with this approach:

public byte[] stringToBase64ByteArray(String input         


        
5条回答
  •  -上瘾入骨i
    2021-02-03 21:19

    All strings in .NET are unicode. This code will produce valid result but the consumer of the BASE64 string should also be unicode enabled.

提交回复
热议问题