The Mask
The Mask

Reputation: 17477

C# utf8_decoding

Equivalent to utf8_decode in php

I have an string: "tópicos" I need convert to "tópicos"

How do this? Thanks,advanced.

Upvotes: 2

Views: 2212

Answers (1)

SLaks
SLaks

Reputation: 888213

You need to get the bytes that that string represents in its original encoding (Windows-1252), then read those bytes as UTF8:

Encoding.UTF8.GetString(Encoding.GetEncoding(1252).GetBytes("tópicos" ))

Upvotes: 7

Related Questions