private static String deviceTranslateEncoding(String encoding) {
        encoding = encoding.toUpperCase(); // CLDC 1.0
        if (encoding.equals("UTF-8") || encoding.equals("UTF8")) {
            return "UTF-8";
            // only upper case ("UTF-8") works on LG phones (at least
            // U8110) and Sony Ericsson JP3 phones (K500, K506, K508,
            // F500, K700, S700, S710a, K300, J300, Z500)
        }
        else if (encoding.equals("ISO-8859-1") // MIME-preferred name
                 || encoding.equals("ISO_8859-1")
                 || encoding.equals("ISO8859_1") // Sun CLDC 1.0 spec
                                                 // and LG-phones
                 ) {
            return "ISO-8859-1";
        }
        else {
            return encoding;
        }
    } // deviceTranslateEncoding