Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js/string_util): u2b(): convert non-Big5 chars to A1BC (□) instea…
…d of FFFD (non-Big5) FFFD is not a valid Big5-UAO character but a Unicode character. Also, it means `IAC DO <lacking option id>` in Telnet protocol if the FF is not replaced by `IAC IAC` (escaped 0xFF). To fix the issue, non-Big5-UAO chars are now converted into A1BC (Big5 '□'). Also, UTF-16 high surrogates are now ignored to make the char count consistent. A1BC (Big5 '□') has been chosen for the following reasons: * Visual feedback when the input has been received and processed. * Non-ASCII code for preventing unwanted operations. This makes all the following cases convert to a single A1BC (□). String | UTF-16 | prev u2b() | Telnet meaning ------------- | --------- | ----------- | -------------- '孒' (U+5B52) | 5B52 | FF FD | IAC DO '𡤼' (U+2193C) | D846 DD3C | FF FD FF FD | IAC DO Extended-Options-List 'FD'
- Loading branch information