728x90 반응형 UTF-82 JSP에서 URL encode 하는 방법 (특수문자 UTF-8 인코딩) param의 값을 UTF-8인코딩하여 값을 넘겨달라는 요청을 받고서 encodeURI() 함수를 사용하여 처리를 했는데 +와 같은 특수문자는 변경이 되지 않았습니다. let url = "https://moonsiri.tistory.com?id="; let id = "dj2nd+s&k3j"; console.log(url+id); // https://moonsiri.tistory.com?id=dj2nd+s&k3j const encoded = url + encodeURI(id); console.log(encoded); // https://moonsiri.tistory.com?id=dj2nd+s&k3j encodeURI() 함수는 URI에서 특별한 뜻을 가진 문자(예약 문자)는 인코딩하지 않기 때문입니다. 예).. 2020. 11. 10. [springboot] sql script(schema.sql, data.sql) 실행 시 한글 깨짐 로컬에서 실행할땐 한글깨짐 문제가 없었는데, 서버에서 빌드 배포 후 실행을 해보니 db에서 값을 가져오는 글자만 한글이 깨져있었습니다. src └ main └ resource └ application.yml └ data.sql └ schema.sql 처음엔 http encoding 문제인가 하여 확인해봤는데, 이미 적용되어 있었습니다. *.jsp application.yml #springboot 1.5.x spring: http: encoding: charset: UTF-8 enabled: true force: true #springboot 2.1.x server: servlet: encoding: charset: UTF-8 다시 확인해보니 http encoding 문제가 아니라 data.sql로 ins.. 2020. 10. 14. 이전 1 다음 728x90 반응형