-
iOS) 서버와 통신할때 get으로 보내는 단어 가 한글일때 인코딩 하는 방법Programing Language/iOS(Swift) 2020. 4. 10. 15:21728x90반응형This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
let str : String = "인기순" print("변환 : ", str.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)) //결과 변환 : %EC%9D%B8%EA%B8%B0%EC%88%9C 사용예시 get의 value 값이 db에서 한글과 일치하다면 https:/localhost.com?keyword=%EC%9D%B8%EA%B8%B0%EC%88%9 // %EC%9D%B8%EA%B8%B0%EC%88%9 <- 인기순 728x90반응형'Programing Language > iOS(Swift)' 카테고리의 다른 글
iOS) Facebook 로그인 연동 custom Buttom으로 만들기 (0) 2020.04.29 iOS) uiObject(예: 이미지뷰) 삭제하는 방법 (0) 2020.04.16 iOS) HEX 코드를 UIColor 변수에 담기 (0) 2020.04.09 iOS) Label에 입력되는 텍스트 중에 특정 단어의 크기나 색 바꾸기[펌] (0) 2020.04.01 iOS) alert(알림) 만들기 (0) 2020.03.26