Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Unicode and __LINE__ in PowerShell

$
0
0

I have two questions:

1. [Text.Encoding]::Convert([Text.Encoding]::ASCII, [Text.Encoding]::UNICODE, [char[]]"AB")
works, but is anything simpler, "compile time" notation, e.g. U"AB" or something similar?

2. Sometime it is convenient to know where a debug print is coming from. The C __LINE__ is a good solution. REXX doesn't have __LINE__, but when a function is called, the caller's line number passed in, so if you call a function, which just returns that line number, the problem is solved. Is any way in PowerShell to add the line number to a printout (hard coded line number is, of course, out of question)?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>