LMs // CRLF compatibility.
This commit is contained in:
parent
d7550f465b
commit
90ccadc580
|
@ -52,7 +52,8 @@ extension vChewing {
|
|||
|
||||
do {
|
||||
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
|
||||
strData.ranges(splitBy: "\n").forEach {
|
||||
strData = strData.replacingOccurrences(of: "\r", with: "\n")
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2 {
|
||||
let theKey = String(neta[0])
|
||||
|
|
|
@ -86,7 +86,8 @@ extension vChewing {
|
|||
|
||||
do {
|
||||
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
|
||||
strData.ranges(splitBy: "\n").forEach {
|
||||
strData = strData.replacingOccurrences(of: "\r", with: "\n")
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2, String(neta[0]).first != "#" {
|
||||
if !neta[0].isEmpty, !neta[1].isEmpty {
|
||||
|
|
|
@ -52,7 +52,8 @@ extension vChewing {
|
|||
|
||||
do {
|
||||
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
|
||||
strData.ranges(splitBy: "\n").forEach {
|
||||
strData = strData.replacingOccurrences(of: "\r", with: "\n")
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2 {
|
||||
let theKey = String(neta[0])
|
||||
|
|
Loading…
Reference in New Issue