Degree Symbols
-
@handyandy How are you trying to display it? I just tried it using a simple command on DWC and it worked:
echo "Heater 0 is " ^ sensors.analog[0].lastReading ^ "°C hot" Heater 0 is -273.1°C hot M118 S"Test: 100°C"
I see the same result when I put it into a macro file and run it.
-
Hi, I tried that and on my printer this is what I get...
12/04/2022, 10:14:53 M98 P"0:/macros/Test"
Heater 0 is 19.6�C hot
Error: Bad command: Heater 0 is -273.1�C hot
Test: 100�C -
Hi again, If I type directly into the 'send' box the following...
echo " Temp is °C"
It works fine and displays correctly. Seems to be as soon as I put it in a macro.
Confused! -
@handyandy Try to edit your macro under the System or Macros tab in DWC. If you enter <alt / 248> there, you should see the degree symbol like this: "°C". Save and run - it will work.
The problem seems to be some weird encoding used by your editor of choice - looks like "Roman-8" but not like UTF8 unicode. -
@handyandy I think @infiniteloop has a good point. Do you edit your macros in DWC or on your PC? If it's edited on the PC, you must set the encoding to UTF-8. If you use the browser, please let me know what browser you are using and I'll try to reproduce the problem here.
-
Hi, I am using Multi-Edit (or Notepad) both produce the same results. I am running Windows 11 and am using Edge as the browser.
Hope this helps. -
@handyandy The character � stands for an unrecognised code point (aka character). This often happens if files are stored in 8-bit ASCII, or sometimes with sparsely populated unicode character sets, too. I won’t debate your choice of editors - the question is what character sets they operate with and how they store their files. That depends on user settings.
Did you check my proposal to edit your macro directly from within DWC?
-
@handyandy those are both very old editors. Do they offer the ability to save the file in UTF8 encoding? If not then I suggest you use a different editor such as Notepad++.
-
Notepad on Win11 lets you select the encoding:
Make sure it is set to UTF-8 or try to edit the macro directly in DWC.
-
Hi, I took on board your comments about my old text editors and looked at Notepad++... I didn't like it. The GUI seems very 'home made in my shed'.
I did however find the 'Atom' editor being recommended so have also tried this. I like it a lot.
It has a really nice and modern looking GUI. It allowed me to load my whole SD card into it as a project. I could then set up my Find/Replace criteria and quickly apply them throughout the project. Brilliant.
I can now also display degree symbols correctly!
Cheers all. -
-