Rest api -> 로컬 -> 주소 검색 관련하여 질문드립니다

다음 지도 API와 REST API 를 사용해서 앱을 개발하고 있습니다.

그런데 개발 중 이해할 수 없는 부분이 발생하여서 이렇게 질문을 드리게 되었습니다.

제가 REST API의 주소 검색을 JSON 방식으로 받아오면 결과값이 한글로 나오지 않습니다.

예를 들어 '전북 삼성동 100’을 query=의 파라미터로 전달하여 값을 받아오면

{“meta”:{“is_end”:true,“total_count”:4,“pageable_count”:4},“documents”:[{“road_address”:{“undergroun_yn”:“N”,“road_name”:"\ub9dd\uc0b0\uae38",“underground_yn”:“N”,“region_2depth_name”:"\uc775\uc0b0\uc2dc",“zone_no”:“54547”,“sub_building_no”:“17”,“region_3depth_name”:"\ubd80\uc1a1\ub3d9",“main_building_no”:“11”,“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \ub9dd\uc0b0\uae38 11-17",“y”:“35.976749396987046”,“x”:“126.99599512792346”,“region_1depth_name”:"\uc804\ubd81",“building_name”:""},“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \ubd80\uc1a1\ub3d9 100",“address”:{“b_code”:“4514013400”,“region_3depth_h_name”:"\uc0bc\uc131\ub3d9",“main_address_no”:“100”,“h_code”:“4514069000”,“region_2depth_name”:"\uc775\uc0b0\uc2dc",“main_adderss_no”:“100”,“sub_address_no”:"",“region_3depth_name”:"\ubd80\uc1a1\ub3d9",“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \ubd80\uc1a1\ub3d9 100",“y”:“35.97664845766847”,“x”:“126.99597295767953”,“mountain_yn”:“N”,“zip_code”:“570972”,“region_1depth_name”:"\uc804\ubd81",“sub_adderss_no”:""},“y”:“35.97664845766847”,“x”:“126.99597295767953”,“address_type”:“REGION_ADDR”},{“road_address”:null,“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \uc5b4\uc591\ub3d9 100",“address”:{“b_code”:“4514012300”,“region_3depth_h_name”:"\uc0bc\uc131\ub3d9",“main_address_no”:“100”,“h_code”:“4514069000”,“region_2depth_name”:"\uc775\uc0b0\uc2dc",“main_adderss_no”:“100”,“sub_address_no”:"",“region_3depth_name”:"\uc5b4\uc591\ub3d9",“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \uc5b4\uc591\ub3d9 100",“y”:“35.95600589647417”,“x”:“126.98746975794619”,“mountain_yn”:“N”,“zip_code”:“570210”,“region_1depth_name”:"\uc804\ubd81",“sub_adderss_no”:""},“y”:“35.95600589647417”,“x”:“126.98746975794619”,“address_type”:“REGION_ADDR”},{“road_address”:null,“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \uc784\uc0c1\ub3d9 100",“address”:{“b_code”:“4514013200”,“region_3depth_h_name”:"\uc0bc\uc131\ub3d9",“main_address_no”:“100”,“h_code”:“4514069000”,“region_2depth_name”:"\uc775\uc0b0\uc2dc",“main_adderss_no”:“100”,“sub_address_no”:"",“region_3depth_name”:"\uc784\uc0c1\ub3d9",“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \uc784\uc0c1\ub3d9 100",“y”:“35.98166138482209”,“x”:“126.98026713191277”,“mountain_yn”:“N”,“zip_code”:“570380”,“region_1depth_name”:"\uc804\ubd81",“sub_adderss_no”:""},“y”:“35.98166138482209”,“x”:“126.98026713191277”,“address_type”:“REGION_ADDR”},{“road_address”:null,“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \uc815\uc871\ub3d9 100",“address”:{“b_code”:“4514013100”,“region_3depth_h_name”:"\uc0bc\uc131\ub3d9",“main_address_no”:“100”,“h_code”:“4514069000”,“region_2depth_name”:"\uc775\uc0b0\uc2dc",“main_adderss_no”:“100”,“sub_address_no”:"",“region_3depth_name”:"\uc815\uc871\ub3d9",“address_name”:"\uc804\ubd81 \uc775\uc0b0\uc2dc \uc815\uc871\ub3d9 100",“y”:“35.98265074446077”,“x”:“127.00208907550905”,“mountain_yn”:“N”,“zip_code”:“570370”,“region_1depth_name”:"\uc804\ubd81",“sub_adderss_no”:""},“y”:“35.98265074446077”,“x”:“127.00208907550905”,“address_type”:“REGION_ADDR”}]}

이러한 결과값이 나오는데, 미숙하지만 예측컨데 한글 앞에 이스케이프 문자가 하나씩 더 추가되어 있는 것 같습니다. (XML형식으로 받아오면 정상적으로 한글로 출력이 됩니다. 그리고 키워드로 장소 검색의 경우에도 정상적으로 한글로 출력이 되고 있습니다. )

혹시 이 부분이 제가 무엇인가를 잘못해서 발생한 사항이라면, 어느 부분에서 문제가 발생한 것인지 궁금하여서 이렇게 글을 남깁니다…도움을 부탁드립니다ㅠ

1개의 좋아요

안녕하세요~
\ub3d9 등은 unicode 형태입니다.
이스케이프 문자가 추가되었거나 한 것은 아니고요.
한글 등이 포함된 문자열이 unicode로 표현된 것입니다.

encoding 방법은 언어 / 라이브러리 별로 여러가지가 있겠으나,
기본적으로는 받은 response를 utf-8 등으로 encoding 하시면 한글로 확인하실 수 있습니다. ^^