How to deal with special characters in a string

encryption, mcrypt, string, variables

Solution

Try base64encode and base64decode. That may be all that you need!

Problem

I have a php script creating an encoded value, for example: ``` m>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[Éå¹UçfU5T°äÙ“©”ˆÇVÝ] [’e™a«Ã°7#dÉJ> ``` I then need to decode this in a vb.net application The problem is that value above can have any characters. And VB.net can't handle it: ``` dim strCryptedString As String = 'm>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[Éå¹UçfU5T°äÙ“©”ˆÇVÝ] [’e™a«Ã°7#dÉJ>" ``` So any suggestions how to deal with that value?

Original source