The length is specified in `erc-split-line-length'.
Currently this is called by `erc-send-input'."
- (if (< (length longline)
- erc-split-line-length)
- (list longline)
+ (let ((charset (car (erc-coding-system-for-target nil))))
(with-temp-buffer
(insert longline)
+ ;; The line lengths are in octets, not characters (because these
+ ;; are server protocol limits), so we have to first make the
+ ;; text into bytes, then fold the bytes on "word" boundaries,
+ ;; and then make the bytes into text again.
+ (encode-coding-region (point-min) (point-max) charset)
(let ((fill-column erc-split-line-length))
(fill-region (point-min) (point-max)
nil t))
+ (decode-coding-region (point-min) (point-max) charset)
(split-string (buffer-string) "\n"))))
(defun erc-forward-word ()