Code Monkey home page Code Monkey logo

Comments (7)

pixelb avatar pixelb commented on August 23, 2024

Could you attach the diff in an email to [email protected].

Does the original version of the script before the recent awk change work any better?
https://raw.githubusercontent.com/pixelb/scripts/bd2aabd/scripts/ansi2html.sh

from scripts.

John-Schlick avatar John-Schlick commented on August 23, 2024

Good question. The reason I came here to get the newest version is that I was using the older version, and thought I'd try the new one. So...

Nope, it also dies with this character.

I'll attach the diff --color (which is a .txt file) to an email to you, as well as the output html that is cut short.

from scripts.

pixelb avatar pixelb commented on August 23, 2024

Seems locale related. I can get new or old script to misbehave when I give it your UTF8 input, but with the locale variables not set. Though I can't get output truncated like you do. I presume there is an error message on stderr when this truncation happens? Are you running the script with a weird environment? If not what is the output from the command: locale

from scripts.

John-Schlick avatar John-Schlick commented on August 23, 2024

I'm just running it on qa linux box, I don't >>think<< that anything is weird about it.

jschlick@dvm-jschlick2:/usr/local/html(BGS-1516)$ locale
LANG=en_US
LANGUAGE=
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

(I've never used this command before, so I just blindly typed it, and this is the output.)

from scripts.

pixelb avatar pixelb commented on August 23, 2024

You're in an is0-8859-1 locale. It's unusual to not be in a UTF8 locale these days.
A probable workaround would be to set a UTF8 locale first like:

git diff | (export LC_ALL=en_US.utf8; ansi2html.sh) > blah.html

I'll work on making it more locale agnostic

from scripts.

John-Schlick avatar John-Schlick commented on August 23, 2024

Your workaround works for this case.
thanks for figuring it out, I'd have probably never gotten there (since I don't actually know what that export does...)

If you do make this more locale agnostic, please let me know, and I'll happily take the new version and apply it to the entire company here.

from scripts.

pixelb avatar pixelb commented on August 23, 2024

The latest version is now more locale agnostic. Could you try it out? I've not marked this bug as fixed though as I wasn't able to recreate your output truncation issue

from scripts.

Related Issues (16)

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.