Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode problems in console #124

Open
Lapizistik opened this issue Dec 14, 2021 · 1 comment
Open

Unicode problems in console #124

Lapizistik opened this issue Dec 14, 2021 · 1 comment

Comments

@Lapizistik
Copy link

Problem

With pry-rails in the Gemfile starting rails c (or bundle exec rails c) gives a pry console.
Typing some unicode character (outside the ASCII range) show incorrect results (i.e. the byte sequence) on the console:
ää,
éé,
â¬,
â¢,

STDIN.external_encoding gives nil

This behaviour started some weeks before, I could not exactly figure out with which version of pry or pry-rails. It worked before with the same rails versions.

Setup

  • Debian 11 (bullseye)
  • ruby 2.7.4p191
  • Rails 6.1.4.1 (and Rails 6.0.3.2)
  • no ~/.pryrc
  • LANG=de_DE.UTF-8

Running rails new testenc and adding pry-rails to the Gemfile (see Gemfile.zip for Gemfile and Gemfile.lock)

Things I tested

  • Starting pry (without rails) works (and STDIN.external_encoding gives #<Encoding:UTF-8>)
  • Starting rails c without the pry-rails gem (irb console): unicode works.
  • Starting pry -r ./config/environment fails with unicode problems (as described)

Changing LANG

spring stop; LANG=C rails c: now typing ä or or any other non-ASCII character shows no echo at all.
But: if spring is still running from before (i.e. without the spring stop) the LANG change has no effect.

No history

Starting pry gives me the history from last time. This also stopped working for pry rails (the history file is not loaded), at the same time (can file a separate issue for this but could also be related).

@Lapizistik
Copy link
Author

Seems to be a problem with bundler and pry. Minimal setup:

mkdir testenc
cd testenc
touch Gemfile
bundler exec pry

→same problem as described above (tried different bundler versions). Still no idea :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant