Giter Site home page Giter Site logo

Comments (5)

JEG2 avatar JEG2 commented on July 18, 2024

Hmm, I'm worried this might be a Windows console issue mort than a HighLine issue.

from highline.

simon-kr avatar simon-kr commented on July 18, 2024

First of all, this seems correct.
I've tried the example with lubuntu and experienced no problems.

But I also found out what the problem is under windows:
In the def say(statement) method in highline.rb, the statement string is always US-ASCII when the statement is a Erb template.

  def say( statement )
    statement = statement.to_str
    puts "Encoding: #{statement.encoding}"
    => "Encoding: US-ASCII"
    ...

This obviously only occures when the statement is an Erb template. But in that case, the "<%= @prompt %>" get's the wrong encoding.

I then changed the encoding to UTF-8 and now it works. I didn't check for any other issues though ...

  def say( statement )
    statement = statement.to_str.encode("UTF-8")
    ...

from highline.

JEG2 avatar JEG2 commented on July 18, 2024

Ah, this is a good point. We should try to find a good policy for handling ERb encoding. Let me think on that a bit and I'll try to come up with a solution…

from highline.

dalyons avatar dalyons commented on July 18, 2024

I think I came up with a decent solution, see #73

from highline.

JEG2 avatar JEG2 commented on July 18, 2024

Thank you.

from highline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.