Dynamic encode and convertion to UTF-8

Post Reply
abrdeco2
Posts: 4
Joined: Tue Jan 18, 2022 11:02 pm

Dynamic encode and convertion to UTF-8

Post by abrdeco2 » Mon Jun 12, 2023 6:54 pm

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é
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Re: Dynamic encode and convertion to UTF-8

Post by alt » Tue Jul 25, 2023 9:54 am

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.
Post Reply