abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
384 stars 46 forks source link

"Attempt to change byte length of a string" error in Emacs 28.0.50 #504

Open dvzubarev opened 2 years ago

dvzubarev commented 2 years ago

Not sure why, but in emacs 28.0.50 this expression is evaluated to t: (multibyte-string-p (encode-coding-string (json-encode "t") 'utf-8 t)) In the previous version of Emacs the result was nil. So this is the same issue as #165 .

To fix this change line: from

(defun ycmd--encode-string (s) (encode-coding-string s 'utf-8 t))))

to

(defun ycmd--encode-string (s) (encode-coding-string s 'utf-8))))
ChoppinBlockParty commented 2 years ago

Thank you! Quick fix.