Reputation:
How can i convert strings in files to utf-8 with power shell?
Upvotes: 0
Views: 182
Reputation: 27423
I like this unescape solution. See also How do I encode Unicode character codes in a PowerShell string literal?
[regex]::unescape('\u2603') # unicode snowman
☃
[regex]::unescape('\u0068\u006f\u006d\u0065')
home
get-content file | foreach { [regex]::unescape($_) } |
set-content file2
Upvotes: 1