Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Convert UTF8 to ANSI?

$
0
0
Hello

I need to convert a UTF-8 string into ANSI so that I can create a user-friendly filename in Windows.

This doesn't work:

Input page:
Code:

<title>Cinéma Paradiso</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Code:
Code:

'BAD EMPTY Dim Response As String = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(e.Result))
Dim Response As String = Encoding.ASCII.GetString(Encoding.UTF8.GetBytes(e.Result))

Output:
Code:

<title>Cin????ma Paradiso</title>
Encoding() doesn't offer ANSI as an option. Should I use another .Net function to convert accented characters to get a legible Windows filename?

Thanks for any help.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>