如何从utf 8解码为Clean Text [英] How to Decode from utf 8 to Clean Text

查看:56
本文介绍了如何从utf 8解码为Clean Text的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


目标:

从utf 8解码为干净文本

Goal:
Decode from utf 8 to clean text


问题:

根据以下代码,它不想从"masaväg"解码to"masaväg"。

Problem:
Based on this code below, it doesn't want to decode from "masaväg" to "masaväg".


我错过了什么部分?

What part am I missing?


谢谢!


信息:

它适用于从"masaväg"解码到"masaväg"在此页 https://www.browserling .com / tools / utf8-decode





   UTF8Encoding utf8 = new UTF8Encoding();
    String unicodeString = "masaväg";
    // Encode the string.
    Byte[] encodedBytes = utf8.GetBytes(unicodeString);
    // Decode bytes back to string.
    String decodedString = utf8.GetString(encodedBytes);





推荐答案

您正在从UTF8转换为UTF8,此处不会有任何改变。您指向的网站没有说明"明文"是什么。对他们来说。看看他们正在运行的脚本,他们似乎只是剥离角色并调整其他人。他们使用的
编码对我来说还不清楚。 

You are converting from UTF8 to UTF8, nothing would change here. The site you pointed to doesn't clarify what "clear text" is to them. Looking at the script they are running, they seem to just be stripping out characters and adjusting others. What encoding they are using is unclear to me. 

对于您的代码,您需要确定要转换为的编码。没有"明文"这样的东西。编码。 Encoding类定义了.NET可以转换为的标准编码。

For your code you need to decide what encoding you want to convert to. There is no such thing as the "clear text" encoding. The Encoding class defines the standard encodings supported by .NET you can convert to.


这篇关于如何从utf 8解码为Clean Text的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆