Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

19 Commits

Repository files navigation

ISO8859

Swift 5.1 compatible

License MIT

Convert ISO8859 1-16 Encoded Text to String in Swift.

Usage

letencoding=ISO8859.part1
letstring=String([...], iso8859Encoding: encoding)

See Examples

Supported Character Sets

EncodingNameEnum
ISO8859-1Latin 1 Western EuropeanISO8859.part1
ISO8859-2Latin 2 Central EuropeanISO8859.part2
ISO8859-3Latin 3 South EuropeanISO8859.part3
ISO8859-4Latin 4 North EuropeanISO8859.part4
ISO8859-5Latin/CyrillicISO8859.part5
ISO8859-6Latin/ArabicISO8859.part6
ISO8859-7Latin/GreekISO8859.part7
ISO8859-8Latin/HebrewISO8859.part8
ISO8859-9Latin 5 TurkishISO8859.part9
ISO8859-10Latin 6 NordicISO8859.part10
ISO8859-11Latin/ThaiISO8859.part11
ISO8859-13Latin 7 Baltic RimISO8859.part13
ISO8859-14Latin 8 CelticISO8859.part14
ISO8859-15Latin 9ISO8859.part15
ISO8859-16Latin 10 South-Eastern EuropeanISO8859.part16

Examples

File to Hebrew Text

iflet path =Bundle.main.path(forResource:"Hebrew-Text", ofType:"txt"),let hebrewTextData =try?Data(contentsOf:URL(fileURLWithPath: path)),let string =String(hebrewTextData, iso8859Encoding:ISO8859.part8){print(string)}

Data to Turkish Text

letturkishTextData=Data(bytes:[84,252,114,107,231,101])iflet string =String(turkishTextData, iso8859Encoding:ISO8859.part9){print(string) // Returns "Türkçe"
}

UInt8 Bytes-Array to Greek Text

letgreekTextbytes:[UInt8]=[0xE1,0xE2,0xE3,0xE4]iflet string =String(greekTextbytes, iso8859Encoding:ISO8859.part7){print(string) // Returns "αβγδ"
}

Installation

Add ISO8859 as a dependency in your Package.swift file:

import PackageDescription
letpackage=Package(
dependencies:[.package(url:"https://github.com/Cosmo/ISO8859.git", from:"1.1.0"),])

Manually

Just drag the source files into your project.

Contact

Other Projects

  • BinaryKit — BinaryKit helps you to break down binary data into bits and bytes and easily access specific parts.
  • Clippy — Clippy from Microsoft Office is back and runs on macOS! Written in Swift.
  • GrammaticalNumber — Turns singular words to the plural and vice-versa in Swift.
  • HackMan — Stop writing boilerplate code yourself. Let hackman do it for you via the command line.
  • SpriteMap — SpriteMap helps you to extract sprites out of a sprite map. Written in Swift.
  • StringCase — Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.
  • TinyConsole — TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.

License

ISO8859 is released under the MIT License.

About

🌍⏩📄 Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages