Code Monkey home page Code Monkey logo

Comments (18)

christopherpickering avatar christopherpickering commented on June 10, 2024 2

I tested on my windows > using the output from stdout from djlint does make the "??":

image

It does seem to be from the default windows encoding for cmd.

Git bash it works :D
image

And running click directly works:
image

So it must be something in the process of writing the temp file to reading it in djlint.

I popped open the temp file that stdin was using... it has the dreaded ??

So I followed the ?? upstream in djlint until I got to the stdin and realized that I was reading it as the systems encoding.. which on windows, is not utf8.

After setting it to read as utf8, and also changing windows shell to utf8, it works:
image

Do djlint needs to be updated to read stdin as utf8. Then djlint-vscode will need to be updated to spawn with utf8.
I'll do a new djlint release w/ this update soon.

from djlint-vscode.

monosans avatar monosans commented on June 10, 2024 2

@christopherpickering
I see that you have released an update that fixes this issue, cool. Can you please check if I need to make any changes to the extension on my end to fix this problem too. It's just that I don't use Windows so I can't test it.

from djlint-vscode.

monosans avatar monosans commented on June 10, 2024 1

Solution: djlint/djLint#243 (comment).

EDIT: This solution is bad. Update djLint to version 1.1.1 or higher to fix the issue.

from djlint-vscode.

Real-Gecko avatar Real-Gecko commented on June 10, 2024 1

Nah I work on Linux and MacOS, but my colleague are not. I've tired of seeing unformatted templates so :D

from djlint-vscode.

monosans avatar monosans commented on June 10, 2024 1

Perhaps this will help solve the issue. I'll do it today when I'm at home.

from djlint-vscode.

christopherpickering avatar christopherpickering commented on June 10, 2024 1

I published djlint 1.1.1, which seems to fix this ๐Ÿš€ No changes to djlint-vscode

Kapture 2022-05-18 at 10 56 35
.

from djlint-vscode.

monosans avatar monosans commented on June 10, 2024 1

Solution - update djLint to version 1.1.1 or higher.

from djlint-vscode.

Real-Gecko avatar Real-Gecko commented on June 10, 2024 1

Hey, guys! We've just checked the update on two machines, one with winduz 10 another with 11. In both cases everything works flawlessly. Thanks for your effort! Really appreciated.

from djlint-vscode.

Real-Gecko avatar Real-Gecko commented on June 10, 2024

Yikes it worked :D
Maybe it should be reflected in a README? so that no one ever asks this question again?

from djlint-vscode.

christopherpickering avatar christopherpickering commented on June 10, 2024

Thats windows for ya ๐Ÿคฃ

from djlint-vscode.

Real-Gecko avatar Real-Gecko commented on June 10, 2024

OK, after enabling utf-8 in winduz some other programs has stopped working as expected. So option was turned off again. So, running from command line works as expected, running through extension does not. Maybe we can tweak something on extension side?
Maybe we can add an option to do formatting inplace and ask editor for reload instead of asking it to replace the text in here?
https://github.com/monosans/djlint-vscode/blob/89073365e968effce95dffd99bbf2dc75d2bb579/src/extension.ts#L247
AFAIK some extensions do that, because I have formatting enabled on save, and when I save the file for some time I see file not being formatted, and then suddenly it changes and is resaved. Noticable when you have a lot of files to save at the same time.

from djlint-vscode.

christopherpickering avatar christopherpickering commented on June 10, 2024

I'll dust of my windows and take a look tomorrow as well. Do you have a small sample code? I'll try w/ ๅฟ…้ ˆ from the other issue otherwise.

from djlint-vscode.

Real-Gecko avatar Real-Gecko commented on June 10, 2024
{% extends 'base.html' %}

{% load i18n django_bootstrap5 %}

{% block content %}
<div class="col-4 offset-4 card">
<div class="card card-body">
<form method="post">
{% csrf_token %}
{% bootstrap_form form %}
<button class="btn btn-primary" type="submit">{% trans "ะ’ั…ะพะด" %}</button>
</form>
</div>
</div>
{% endblock content %}

This one will do I guess notice the {% trans "ะ’ั…ะพะด" %} part.

from djlint-vscode.

monosans avatar monosans commented on June 10, 2024

AFAIK they use PowerShell as VSCode shell. Don't know what is encoding for this one.

The extension does not launch a shell, but launches Python directly.

from djlint-vscode.

christopherpickering avatar christopherpickering commented on June 10, 2024

Windows is being pretty persistent. The colorize library was also allowing windows to tweak the encoding.. so I need to do another update the djlint to ensure the output is passed to the printer as utf8.

I was able to get it to work in vscode, I'll test a bit more and see if anything needs to be pr'ed.

from djlint-vscode.

monosans avatar monosans commented on June 10, 2024

I published djlint 1.1.1, which seems to fix this No changes to djlint-vscode

Amazing! Thank you very much!

I will later write in README.md that djLint version 1.1.1 or higher is required to fix this issue.

from djlint-vscode.

christopherpickering avatar christopherpickering commented on June 10, 2024

No problem, thank you!

from djlint-vscode.

christopherpickering avatar christopherpickering commented on June 10, 2024

Nice!

from djlint-vscode.

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.