mirror of
https://github.com/irmen/prog8.git
synced 2024-06-10 20:29:33 +00:00
ddb8346711
cx16: added new character encodings, and routines in textio to enable the character sets for them. cx16: added txt.chrout_lit() and txt.print_lit() to always print the literal characters and never as control codes
20 lines
735 B
Kotlin
20 lines
735 B
Kotlin
package prog8.code.core
|
|
|
|
enum class Encoding(val prefix: String) {
|
|
DEFAULT("default"), // depends on compilation target
|
|
PETSCII("petscii"), // c64/c128/cx16
|
|
SCREENCODES("sc"), // c64/c128/cx16
|
|
ATASCII("atascii"), // atari
|
|
ISO("iso"), // cx16 (iso-8859-15)
|
|
ISO5("iso5"), // cx16 (iso-8859-5, cyrillic)
|
|
ISO16("iso16"), // cx16 (iso-8859-16, eastern european)
|
|
CP437("cp437") // cx16 (ibm pc, codepage 437)
|
|
}
|
|
|
|
interface IStringEncoding {
|
|
val defaultEncoding: Encoding
|
|
|
|
fun encodeString(str: String, encoding: Encoding): List<UByte>
|
|
fun decodeString(bytes: Iterable<UByte>, encoding: Encoding): String
|
|
}
|