Ho una domanda su Charset.forName (String charsetName). C'è una lista di nomi charset a cui posso fare riferimento? Ad esempio, per UTF-8, usiamo "utf8" per charsetName. Che mi dici di WINDOWS-1252, GB18030, ecc.?Codifica CharsetNames per Charset.forName (String)
5
A
risposta
5
Charset Description US-ASCII Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set ISO-8859-1 ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 UTF-8 Eight-bit UCS Transformation Format UTF-16BE Sixteen-bit UCS Transformation Format, big-endian byte order UTF-16LE Sixteen-bit UCS Transformation Format, little-endian byte order UTF-16 Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark
Riferimento: http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html
2
I nomi charset in Java sono dipendenti dalla piattaforma, ci sono solo 6 costanti nella classe StandardCharsets.
Per visualizzare tutti i set di caratteri, è necessario guardare IANA. Controllare le colonne Nome e alias MIME preferiti.
Problemi correlati
- 1. Java String codifica (UTF-8)
- 2. Charset.for.Java ("ASCII") o Charset.forName ("US-ASCII")
- 3. String non codifica url in iOS
- 4. codifica da utilizzare per convertire byte array String e viceversa
- 5. Forza XDocument per scrivere su String con codifica UTF-8
- 6. String problema di codifica in Webview
- 7. Rimuovere caratteri non adatti alla codifica UTF-8 da String
- 8. XDocument to string: Come omettere la codifica nella dichiarazione?
- 9. C'è un modo per specificare la codifica dei caratteri al java.lang.StringBuilder
- 10. bug Java? Perché extra zero byte nella codifica utf8?
- 11. Converti ByteBuffer in String in Java
- 12. ArrayList <HashMap <String, String >> per String []
- 13. NotSerializableException per `Map [String, String]` alias
- 14. Come gestire la codifica in lxml per analizzare correttamente html-string?
- 15. Codifica Python per pipe.communicate
- 16. Perché no URLEncoder.encode (String, Charset), URLDecoder.decode (String, Charset)
- 17. Converti XmlDocument per String
- 18. Codifica HTML per HtmlHelper Extension Method
- 19. Codifica UTF-8 con FileBody in MultipartEntity
- 20. Codifica Python 36 codifica
- 21. ByteBuffer, CharBuffer, String e Charset
- 22. HttpUtility.ParseQueryString() codifica sempre caratteri speciali per unicode
- 23. BigDecimal scala ottimale per la codifica
- 24. Linee guida per la codifica + Best practice?
- 25. ragioni pratiche per Сhurch codifica
- 26. Applicare Codifica per intero Data.Table
- 27. codifica utilizzata per u "" letterali
- 28. Aggiungere codifica UTF-8 per ResponseEntity
- 29. codifica encoder codifica valori mancanti
- 30. Java convertire flusso di caratteri in umana String "leggibile"
http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html e l'ultimo http://download.java.net/jdk8/docs/technotes/guides /intl/encoding.doc.html – nullpotent
Inoltre c'è una buona discussione su http://stackoverflow.com/questions/1684040/java-why-charset-names-are-not-constants –