gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

formatter exenstion Multibyte character error #136

Closed mstenek closed 6 months ago

mstenek commented 6 months ago

Hello

I'm getting this error format: Multibyte character in data for base64 encoding when I try to use julia-snail/formatter-format-buffer.

Editing the following

(defun julia-snail/formatter--format-text (txt)
  (julia-snail--send-to-server
    '("JuliaSnail" "Extensions" "Formatter")
    (let ((ubs (string-as-unibyte txt)))
      (format "format_data(\"%s\")" (base64-encode-string ubs)))
    :async nil))

to include the string-as-unibyte bit, fixes the issue. Is this correct?

gcv commented 6 months ago

Seems reasonable. Feel free to open a PR.