πŸŒβ©πŸ“„ Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.

Overview

ISO8859

Swift 5.1 compatible

License MIT

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

Usage

let encoding = ISO8859.part1
let string = String([...], iso8859Encoding: encoding)

See Examples

Supported Character Sets

Encoding Name Enum
ISO8859-1 Latin 1 Western European ISO8859.part1
ISO8859-2 Latin 2 Central European ISO8859.part2
ISO8859-3 Latin 3 South European ISO8859.part3
ISO8859-4 Latin 4 North European ISO8859.part4
ISO8859-5 Latin/Cyrillic ISO8859.part5
ISO8859-6 Latin/Arabic ISO8859.part6
ISO8859-7 Latin/Greek ISO8859.part7
ISO8859-8 Latin/Hebrew ISO8859.part8
ISO8859-9 Latin 5 Turkish ISO8859.part9
ISO8859-10 Latin 6 Nordic ISO8859.part10
ISO8859-11 Latin/Thai ISO8859.part11
ISO8859-13 Latin 7 Baltic Rim ISO8859.part13
ISO8859-14 Latin 8 Celtic ISO8859.part14
ISO8859-15 Latin 9 ISO8859.part15
ISO8859-16 Latin 10 South-Eastern European ISO8859.part16

Examples

File to Hebrew Text

if
    let 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

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

UInt8 Bytes-Array to Greek Text

let greekTextbytes: [UInt8] = [0xE1, 0xE2, 0xE3, 0xE4]
if let string = String(greekTextbytes, iso8859Encoding: ISO8859.part7) {
    print(string) // Returns "Ξ±Ξ²Ξ³Ξ΄"
}

Installation

Swift Package Manager

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

import PackageDescription

let package = 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.

You might also like...
Great Swift String Pluralize Extension

Pluralize.swift Great Swift String Pluralize Extension case-insensitive tons of rules for irregular nouns (plural form) supports uncountable nouns all

πŸ‘©β€πŸŽ¨ Elegant Attributed String composition in Swift sauce
πŸ‘©β€πŸŽ¨ Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

A comprehensive, lightweight string extension for Swift

SwiftString SwiftString is a lightweight string extension for Swift. This library was motivated by having to search StackOverflow for common string op

Swift emoji string parsing library
Swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji

A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters

NSString+Emojize A category on NSString to turn codes from Emoji Cheat Sheet into Unicode emoji characters. Getting Started In order to use NSString+E

Easy string decoration with styles
Easy string decoration with styles

StyleDecorator Design string simply by linking attributes. Example Create Decorator with specific Style and link it at the end of needed string or wra

Easy Attributed String Creator
Easy Attributed String Creator

The main idea of this project is to have an online tool to be able to visually add formatting to a text and get back a swift and/or objective-c code t

Fully open source text editor for iOS written in Swift.
Fully open source text editor for iOS written in Swift.

Edhita Fully open source text editor for iOS written in Swift. http://edhita.bornneet.com/ What Edhita means? Edhita (Romaji) == エディタ (Katakana) == Ed

Comments
Releases(1.1.0)
Owner
Devran Cosmo Uenal
I ❀️ gadgets.
Devran Cosmo Uenal
More powerful label, attributed string builder and text parser.

DDText More powerful label, attributed string builder and text parser. DDLabel More powerful label than UILabel, using TextKit. It supports features b

Daniel 16 Nov 8, 2022
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Atributika is an easy and painless way to build NSAttributedString. It is able to detect HTML-like tags, links, phone numbers, hashtags, any regex or

Pavel Sharanda 1.1k Jan 8, 2023
An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.

PrediKit A Swift NSPredicate DSL for iOS & OS X inspired by SnapKit, lovingly written in Swift, and created by that weird dude at KrakenDev. If you're

Hector Matos 542 Sep 24, 2022
Powerful text framework for iOS to display and edit rich text.

YYText Powerful text framework for iOS to display and edit rich text. (It's a component of YYKit) Features UILabel and UITextView API compatible High

null 8.8k Jan 4, 2023
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.

twitter-text This repository is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, tes

Twitter 2.9k Dec 27, 2022
An iOS app to turn typed text into images of handwritten text in your own handwriting style.

Text-to-Handwritting Β© 2021 by Daniel Christopher Long An iOS app to turn typed text into images of handwritten text in your own handwriting style. ht

Daniel Long 11 Dec 29, 2022
String (and more) validation for iOS

Swift Validators ?? String validation for iOS. Contents Installation Walkthrough Usage Available validators License ReactiveSwift + SwiftValidators Wa

George Kaimakas 241 Nov 13, 2022
A Cross-Platform String and Regular Expression Library written in Swift.

Guitar ?? A Cross-Platform String and Regular Expression Library written in Swift. About This library seeks to add common string manipulation function

Arthur Ariel Sabintsev 659 Dec 27, 2022
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

Rightpoint 3.4k Dec 30, 2022
Croc is a swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji characters, making emoji-powered features an easy task for developers.

Joe Kalash 127 Nov 20, 2022