Documentation
¶
Index ¶
- func DecodeGSM7(gsm7 []byte) (str string)
- func EncodeGSM7(str string) []byte
- func IsValidGSM7(text string) bool
- func ReplaceSubstitutions(text string) string
- type DataCoding
- func (c DataCoding) Encoding() Encoding
- func (c DataCoding) GoString() string
- func (c DataCoding) MessageClass() (coding DataCoding, class int)
- func (c DataCoding) MessageWaitingInfo() (coding DataCoding, active bool, kind int)
- func (c DataCoding) Splitter() Splitter
- func (c DataCoding) String() string
- func (c DataCoding) Validate(input string) bool
- type Splitter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGSM7 ¶
Decode decodes the passed in bytes as GSM7 encodings. Each byte is expected to be a single 7 bit GSM7 character.
func EncodeGSM7 ¶
Encode encodes the given UTF-8 text into a string composed of GSM7 bytes. Each 7 bit GSM7 char is encoded in a single byte
func IsValidGSM7 ¶
IsValid returns whether the passed in string is made up of entirely GSM7 characters
func ReplaceSubstitutions ¶
ReplaceSubstitutions replaces all the non-GSM7 characters that have valid substitutions with their GSM7 versions
Types ¶
type DataCoding ¶
type DataCoding byte
const ( GSM7BitCoding DataCoding = 0b00000000 // 0 - GSM 7Bit (7 bit) ASCIICoding DataCoding = 0b00000001 // 1 - ASCII (ISO-8859-9) (8 bit) OctetCoding DataCoding = 0b00000010 // 2 - Octet unspecified (8-bit) Latin1Coding DataCoding = 0b00000011 // 3 - Latin-1 (ISO-8859-1) (8 bit) OctetCoding4 DataCoding = 0b00000100 // 4 - Octet unspecified (8-bit) ShiftJISCoding DataCoding = 0b00000101 // 5 - JIS (X 0208-1990) (16 bit) CyrillicCoding DataCoding = 0b00000110 // 6 - Cyrllic (ISO-8859-5) (8 bit) HebrewCoding DataCoding = 0b00000111 // 7 - Latin/Hebrew (ISO-8859-8) (8 bit) UCS2Coding DataCoding = 0b00001000 // 8 - UCS2/UTF-16 (ISO/IEC-10646) (16 bit) ISO2022JPCoding DataCoding = 0b00001010 // 10 - Music Codes (ISO-2022-JP) EUCJPCoding DataCoding = 0b00001101 // 13 - Extended Kanji JIS (X 0212-1990) EUCKRCoding DataCoding = 0b00001110 // 14 - Korean Graphic Character Set (KS C 5601/KS X 1001) NoCoding DataCoding = 0b10111111 // 15-255 Reserved (Non-specification definition) )
func BestAllCoding ¶
func BestAllCoding(input string, isGSM7Supported bool) DataCoding
func BestCoding ¶
func BestCoding(input string, isGSM7Supported bool) DataCoding
func BestSafeCoding ¶
func BestSafeCoding(input string, isGSM7Supported bool) DataCoding
func GetDataCoding ¶
func GetDataCoding(code int) DataCoding
func (DataCoding) GoString ¶
func (c DataCoding) GoString() string
func (DataCoding) MessageClass ¶
func (c DataCoding) MessageClass() (coding DataCoding, class int)
MessageClass ...
func (DataCoding) MessageWaitingInfo ¶
func (c DataCoding) MessageWaitingInfo() (coding DataCoding, active bool, kind int)
MessageWaitingInfo ...
func (DataCoding) String ¶
func (c DataCoding) String() string
Click to show internal directories.
Click to hide internal directories.