怎么让特殊字符在文本文档中正确显示?

我在文本文档中保存象♡这样的特殊字符时,会出现这样一段话:"该文件含有Unicode格式的字符,当文件保存为ANSI编码的文本文件时,该字符将丢失,要保存Unicode信息,单击下面的"取消",然后从编码列表中选择一个Unicode选项.
我照它说的做了,保存时把编码换成Unicode的了,可是我再打开文本文档,特殊字符仍然无法正确显示,请问下这是怎么回事呢?怎么样才能让特殊字符再文本文档中正确显示?

给你一段特殊代码对应表。在本地建个文本文件,拷贝以下内容,之后改文件格式为html。就可以看了。

<html>
<head>
<title>Special characters
          
                
                
                
                
              
         </title>
<script language="javascript">function writeChars()
{
var tds = 22;

var str = "";

for (var i = 33; i < 256; )
{
document.write('<tr>');

for (var j = 0; j <= tds; j++)
{
document.write(
'<td style=\"align: left; height: 20; font-size: 12px; FONT-FAMILY: Verdana;\" bgcolor=white width=\"18\" align=center onClick=\"getchar(this)\" onmouseover=\"spcOver(this)\" onmouseout=\"spcOut(this)\" title=\"' + i + ';\" >');

document.write('&#' + i + ';');
document.write('</td>');
i++;
}

document.write('</tr>');
}

;
}

function spcOver(el)
{
el.style.background = "#0A246A";

el.style.color = "white";
}

function spcOut(el)
{
el.style.background = "white";

el.style.color = "black";
}

function getchar(obj)
{
if (!obj.innerHTML)
return;

document.all.char.value = "&#" + obj.title || "";
}

function cancel()
{
window.returnValue = null;

window.close();
}

</script>
</head>
<body bgcolor="buttonface">

<form id="Insert_chart" method="post" runat="server">
<table border="0" cellspacing="2" cellpadding="2" width="96%" align="center">
<tr>
<td align="center">
<fieldset style="padding-bottom:5px" align="center" style="font-family: MS Sans Serif; font-size: 9pt; vertical-align: middle; cursor: hand;">
<legend>
Special characters
</legend>
<br>
<TABLE width="95%" cellspacing="1" cellpadding="1" border="0" bordercolor="dimgray" align="center" bgcolor="dimgray">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
writeChars();
-->
</SCRIPT>
</TABLE>
</fieldset>
</td>
</tr>
<tr>
<td align="right">
<input type="text" id="char" />
<BUTTON style="font-family: MS Sans Serif; font-size: 9pt; vertical-align: middle; cursor: hand; font-size: x-small;" type="reset" onclick="cancel()" id="button1" name="button1">
Cancel
</BUTTON>
</td>
</tr>
</table>
</form>
</body>
</html>
温馨提示:答案为网友推荐,仅供参考