Android 未显示特殊字符的网页

Android 未显示特殊字符的网页,android,Android,我有一个“.HTML”文件,它存储在“res\raw”文件夹中。 我使用以下代码显示文件的内容: static String TAG="WebPageShowActivity"; WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCo

我有一个“.HTML”文件,它存储在“res\raw”文件夹中。 我使用以下代码显示文件的内容:

static String TAG="WebPageShowActivity";
    WebView mWebView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webpagedisplay);
        String summary = readRawTextFile(this,R.raw.spotlighterhelp);
                //getResources().openRawResource(R.raw.spotlighterhelp).toString();
        mWebView = (WebView) findViewById(R.id.webview);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.loadDataWithBaseURL (null,summary, "text/html","ASCII" ,null);
    }
     public static String readRawTextFile(Context ctx, int resId)
     {
          InputStream inputStream = ctx.getResources().openRawResource(resId);

          InputStreamReader inputreader = new InputStreamReader(inputStream);
          BufferedReader buffreader = new BufferedReader(inputreader);
          String line;
          StringBuilder text = new StringBuilder();

          try {
            while (( line = buffreader.readLine()) != null) {
                text.append(line);
              }
          } catch (IOException e) {
              return null;
          }
          Log.e(TAG, "file content: "+text.toString());
          return text.toString();
     }
现在,我的问题是:无论是哪种类型的编码,它都不会显示特殊字符,比如“或者”我该怎么做才能让这些字符也显示出来

下面是我得到的输出

我认为它可能会起作用,尝试使用
UTF-8
而不是
ASCII
作为您的网络视图

mWebView.loadDataWithBaseURL (null,summary, "text/html","UTF-8" ,null);

问题解决了。我已将.doc文件转换为.html,因此我已将“”转换为一些特殊字符。现在已将其替换,工作正常