⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 encodingstest.java

📁 Python Development Environment (Python IDE plugin for Eclipse). Features editor, code completion, re
💻 JAVA
字号:
package org.python.pydev.core;

import java.nio.charset.Charset;

import junit.framework.TestCase;

public class EncodingsTest extends TestCase {

    public static void main(String[] args) {
        junit.textui.TestRunner.run(EncodingsTest.class);
    }
    public void testRefEncoding() throws Exception {
        String validEncoding = REF.getValidEncoding("latin-1", null);
        assertEquals("latin1", validEncoding);
        
        //supported
        assertTrue(Charset.isSupported("latin1"));
        assertTrue(Charset.isSupported("utf8"));
        assertTrue(Charset.isSupported("utf_16"));
        assertTrue(Charset.isSupported("UTF-8"));
        assertTrue(Charset.isSupported("utf-8"));

        //not supported
        assertTrue(!Charset.isSupported("latin-1"));
        assertTrue(!Charset.isSupported("utf_8")); //why utf_16 is supported and utf_8 is not is something that really amazes me.
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -