Page 1 of 1

Dynamic encode and convertion to UTF-8

Posted: Mon Jun 12, 2023 6:54 pm
by abrdeco2
Hello.

I´m currently stuck dealing with different encodings received.

Anyone can help with some snippet to identify the current encode and correctly convert to UTF-8 to permit store in a database ?

Thankyou,
André

Re: Dynamic encode and convertion to UTF-8

Posted: Tue Jul 25, 2023 9:54 am
by alt
Hello,

Inetlab.SMPP library provides two extension methods CanBeDecoded, CanBeEncoded

https://docs.inetlab.com/smpp/v2.9/api/ ... sions.html

With these methods you can check if text can be encoded with specified encoding or if the byte array can be decoded with the encoding.