Giter Club home page Giter Club logo

Comments (7)

unstppbl avatar unstppbl commented on May 26, 2024

On Windows 10 you should use -UseBasicParsing option for Invoke-WebRequest cmd, so the command will look like this:

powershell ((Invoke-WebRequest -UseBasicParsing -Uri wttr.in/Astana?format=3).Content)

But another problem is that weather emojis and symbols are not recognized properly in Obsidian:

image

from templater.

SilentVoid13 avatar SilentVoid13 commented on May 26, 2024

Hello @yeders, sorry for the last answer.
I updated the README to include the -UseBasicParsing option as suggested by @unstppbl.
So in your case, this would give powershell ((Invoke-WebRequest -UseBasicParsing -Uri wttr.in/Campsie?format=3).Content)
Could tell me if this command works for you ?
The emojis are another problem that comes from powershell.

from templater.

jessycormier avatar jessycormier commented on May 26, 2024

@SilentVoid13 I can confirm it doesn't work on windows 10. This isn't just in Obsidian either, it's within PowerShell. However, copying the broken text from PowerShell into Obsidian will make it display correctly. Perhaps this has something to do with how the website is encoding the text?

from templater.

jessycormier avatar jessycormier commented on May 26, 2024

chubin/wttr.in#18 (comment)

Using windows newer terminal supports the emoji's and other features

I do find it odd that Templater when copying the output and once inside of Obsidian it doesn't display correctly but doing it manually does.

from templater.

jroachgit avatar jroachgit commented on May 26, 2024

My curl command in Win10 is working.
image

Working:
curl "wttr.in/Campsie?format=%l:+%C+%t+%p+%w+%h"

Not working:
powershell ((Invoke-WebRequest -UseBasicParsing -Uri wttr.in/Campsie?format=3).Content)

from templater.

luckman212 avatar luckman212 commented on May 26, 2024

Got a solution for this:

Follow these steps:

Make UTF8 the global default

  1. run intl.cpl
  2. click Change system locale
    image
  3. enable Use Unicode UTF-8
    image
  4. reboot

Templater Template weather

powershell -command "& { (Invoke-WebRequest -Uri 'wttr.in/NewYork?format=3').Content }"

Trigger with <% tp.user.weather() %>

Result

image

from templater.

SilentVoid13 avatar SilentVoid13 commented on May 26, 2024

As @luckman212 said, unicode chars problems are not coming from Templater, but from cmd.exe and powershell.
I added some documentation on solutions to fix this problem: https://silentvoid13.github.io/Templater/docs/faq#unicode-characters-emojis--are-not-working-on-windows-
Closing this.

from templater.

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.