한글 썸네일형 리스트형 RestTemplate 한글 깨짐 FCM 연동 중 한글 깨짐 현상 발생 시 다음과 같이 메세지 컨버터의 인코딩을 변경한다. Kotlin val restTemplate = RestTemplate().apply { messageConverters.forEach { if(it is StringHttpMessageConverter) { it.defaultCharset = Charset.forName("UTF-8") } } } 더보기 한글 byte로 자르기(깨짐 없이) 쓸때마다 새로만드는 것 같아서 저장용 UTF-8일 경우subStringBytes("블라블라블라라", 10, 3);EUC-KR일 경우subStringBytes("블라블라블라라", 10, 2); public String subStringBytes(String str, int byteLength, int sizePerLetter) { int retLength = 0; int tempSize = 0; int asc; if (str == null || "".equals(str) || "null".equals(str)) { str = ""; } int length = str.length(); for (int i = 1; i 127) { if (byteLength >= tempSize + sizePerLetter) .. 더보기 이전 1 다음