링크 미리보기 띄워줄 때 Content-Type
의 charset
파라미터 보고 문자열 디코딩하게 했는데, charset
파라미터 자체를 안 주는 경우가 좀 있는 것 같다. (주로 일본 쪽 미디어…) charset
파라미터 없으면 UTF-8로 가정하게 해놨더니 다 깨진다. 가서 보면 SHIFT-JIS 쓰고 있음. 😇 결국에는 chardet을 쓸 수밖에 없나…
If you have a fediverse account, you can reply to this note from your own instance. Search https://hackers.pub/ap/notes/0195d1da-bd46-735e-9a02-7ba0c87a4a79 on your instance and reply to it.