update for 1.2
This commit is contained in:
parent
937090458c
commit
3e260152cb
@ -27,7 +27,7 @@ import Foundation
|
|||||||
|
|
||||||
var memoizer = [String: UnicodeScalar]()
|
var memoizer = [String: UnicodeScalar]()
|
||||||
|
|
||||||
func lookup(base:UnicodeScalar, combi:UnicodeScalar) -> UnicodeScalar {
|
private func lookup(base:UnicodeScalar, combi:UnicodeScalar) -> UnicodeScalar {
|
||||||
let combined = "\(base)\(combi)"
|
let combined = "\(base)\(combi)"
|
||||||
|
|
||||||
if let y = memoizer[combined] {
|
if let y = memoizer[combined] {
|
||||||
@ -54,13 +54,13 @@ func fixDoubleUTF8(inout name:String) {
|
|||||||
|
|
||||||
for ch in name.unicodeScalars {
|
for ch in name.unicodeScalars {
|
||||||
if ch.value < 0x80 {
|
if ch.value < 0x80 {
|
||||||
y.append(UInt8(ch))
|
y.append(UInt8(ch.value))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
isASCII = false
|
isASCII = false
|
||||||
|
|
||||||
if ch.value < 0x100 {
|
if ch.value < 0x100 {
|
||||||
y.append(UInt8(ch))
|
y.append(UInt8(ch.value))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// might be a combining character that when combined with the
|
// might be a combining character that when combined with the
|
||||||
@ -77,7 +77,7 @@ func fixDoubleUTF8(inout name:String) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
y.append(UInt8(repl))
|
y.append(UInt8(repl.value))
|
||||||
}
|
}
|
||||||
|
|
||||||
if isASCII {
|
if isASCII {
|
||||||
@ -92,7 +92,11 @@ func fixDoubleUTF8(inout name:String) {
|
|||||||
if let str = rslt.0 {
|
if let str = rslt.0 {
|
||||||
if !rslt.hadError {
|
if !rslt.hadError {
|
||||||
name = str
|
name = str
|
||||||
|
} else {
|
||||||
|
println("error")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
println("error")
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user