user9927
user9927

Reputation: 639

UTF8 Character Encoding Error

I'm currently outputting a long string through powershell as unicode using the below syntax (reference for doing it this way):

$string | out-file $path -encoding unicode

If I try to import this file in mongo, or another process that can't read UTF8 characters, I get an "Invalid UTF8 character detected." Is this the incorrect syntax?

Upvotes: 1

Views: 525

Answers (1)

Keith Hill
Keith Hill

Reputation: 201832

Unicode is not the same encoding as Utf8. Have you tried -encoding ASCII or -encoding Utf8?

Upvotes: 2

Related Questions