이 텍스트에서는 json 파일의 일부 텍스트를 사용했습니다. utf8 인코딩을 적용했지만이 인코더는 비표준 문자를 인식하지 못하고 대문자입니다. 엄마 끈을 정화하는거야? 여기 내 FUNC신속한 UTF8 인코딩 및 비 UTF8 문자
func stringToUTF8String (stringaDaConvertire stringa: String) -> String {
let encodedData = stringa.dataUsingEncoding(NSUTF8StringEncoding)!
let attributedOptions = [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType]
let attributedString = NSAttributedString(data: encodedData, options: attributedOptions, documentAttributes: nil, error: nil)!
//println(attributedString.string)
return attributedString.string
}
감사의
'String '은 어떤 바이트 출력을 제공합니까? 너는 무엇을 기대 하느냐? 또한 StackOverflow에 비표준 문자를 올바르게 삽입했는지 확신 할 수 없습니다. – Tommy
실제 출력 및 예상 출력과 함께 문제를 설명하는 (짧은) 입력 문자열을 표시하십시오. –