Created
October 13, 2020 07:22
-
-
Save antop-dev/36fbe3c2cb40ec7d01146858055d5f2d to your computer and use it in GitHub Desktop.
나는 UTF-8을 사용하고 외부에서 EUC-KR로 요청이 올 때 받기
This file contains hidden or 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
| import org.springframework.web.filter.CharacterEncodingFilter; | |
| public class EucKrEncodingFilter extends CharacterEncodingFilter { | |
| public EucKrEncodingFilter() { | |
| setEncoding("EUC-KR"); | |
| setForceEncoding(true); | |
| } | |
| } |
This file contains hidden or 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
| import org.springframework.context.annotation.Configuration; | |
| @Configuration | |
| public class WebConfig { | |
| @Bean | |
| FilterRegistrationBean<EucKrEncodingFilter> eucKrEncodingFilter() { | |
| FilterRegistrationBean<EucKrEncodingFilter> registrationBean = new FilterRegistrationBean<>(); | |
| registrationBean.setFilter(new EucKrEncodingFilter()); | |
| registrationBean.addUrlPatterns("/this-url"); | |
| return registrationBean; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
한글이 깨지는 걸 해결할 수 있다.