Can Notepad++ convert multiple opened files to ANSI (encoding)?

9,034

Suppose that your utf8bom files are in c:\temp\utf8\

I am saving the ansi files to c:\temp\ansi\

At command line,

> powershell
PS> get-item c:\temp\utf8\*.* | foreach-object {get-content $_ | out-file ("c:\temp\ansi\" + $_.Name) -encoding default}
PS> exit
>

What it does is that for each file in c:\temp\utf8, get its content and output to a file with the same filename in c:\temp\ansi with the Windows system default encoding, which is equivalent to ANSI you meant.

get-content command here can read the text without you specifying utf8 with or without bom.

Share:
9,034

Related videos on Youtube

Abd
Author by

Abd

Updated on September 18, 2022

Comments

  • Abd
    Abd over 1 year

    I have 50 text files which need to be converted from utf-8 bom to ANSI. In Notepad++ We can do it with single file, but I want all opened files to be converted to ANSI in one short way. Is there any option there?

    • chingNotCHing
      chingNotCHing over 7 years
      It seems that u need a way in command line to do it. Have you looked for a powershell solution?
    • Abd
      Abd over 7 years
      i did not try., im not a power user or script writer. just looking for a tool that could do this job. any other way?. if it can be done in command line please let me know how to do it.