ahyatt / emacs-websocket

A websocket implementation in elisp, for emacs.
GNU General Public License v2.0
324 stars 42 forks source link

Is encode-coding-string (quote utf-8) necessary? #59

Closed dickmao closed 5 years ago

dickmao commented 5 years ago

Follow-up to https://github.com/millejoh/emacs-ipython-notebook/issues/559

The cl-loop presumably produces the unibyte string from earlier revisions. Wrapping that value in an encode-coding-string could only change the return value of websocket-mask.

ahyatt commented 5 years ago

Are you saying that this fixes the ipython disconnect issues?

While my new code might be wrong, it was done because make-unibyte-string has been deprecated, and as the comment above indicates, we need something so that the bytes are interpreted as unibyte only. But possibly utf-8 is not the correct value that I should be using. I'll investigate this further.

dickmao commented 5 years ago

Are you saying that this fixes the ipython disconnect issues?

Yes.

make-unibyte-string has been deprecated, and as the comment above indicates, we need something so that the bytes are interpreted as unibyte only

Ah, okay. A quick google of unibyte-string deprecated yielded no obvious indications of deprecation. Is string-as-unibyte deprecated? Because I just added it to the PR to respect the comment.

ahyatt commented 5 years ago

I think this is fine for now - at least it solves the pressing issue of things not working.

Looking into this further, I think that the way I'm constructing the string with my latest changes does make encode-coding-string unnecessary, and things should always be unibyte. But let me verify that on my own time.

Thank you for the fix!