Skip to content

Instantly share code, notes, and snippets.

View tatetate55's full-sized avatar
🌴
On vacation

Kazuhiro Kamakura tatetate55

🌴
On vacation
View GitHub Profile
@tatetate55
tatetate55 / StringExtensionHTML.swift
Created February 7, 2017 07:20 — forked from mwaterfall/StringExtensionHTML.swift
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",