I am trying to insert a degree sign into a string, but nothing comes out of it. Tell me how can this be implemented in Perl?

Closed due to the fact that the essence of the question is not clear to the participants aleksandr barakin , Streletz , D-side , zRrr , Nick Volynkin Jun 3 '16 at 6:18 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • And where is this line "displayed"? - KoVadim
  • Well, these are generally internal scripts. There is an alert template script, the data on the coordinates taken from the base are inserted there. I need to finish the literate format. - Warden
  • Well, for example, $_="\x{0B0}"; Excellent in variable degrees. But when outputting this line somewhere, the output file descriptor should of course be in UTF8 mode, so that two bytes of C2 B0 are output, and not just B0. In addition, the degree symbol can be safely written directly in the program text (the program should of course be with use utf8 ) - Mike
  • Clearly, the answer will have to pull out. If the scripts are output to the console and she understands utf-8 normally (usually this is the case, but some people like it in koi-8), then just copy it and paste it into your script. Here it is ° . (yes, the editor should also edit in utf-8). If this is not the case, search for this character for your encoding. - KoVadim
  • How to write a degree sign, I understand. Now the question that asked the first commentator has become more understandable. Now output to the console for verification. There is an abracadabra. And ultimately, this is all sent via email and in the web interface. - Warden

1 answer 1

Option to directly add the degree symbol:

 perl -E 'say "100°C"' 100°C 

Option with the addition of a degree symbol code:

 perl -E 'use open ":std", ":encoding(utf8)"; say "100\x{0b0}C"' 100°C