pdiddo
Goto Top

txt mit UTF-8 Codierung per batch in ANSI Codierung umwandeln

Hi Leute,

ich brauche eure Hilfe.


Ich habe eine .txt Datei die in UTF-8 codiert ist.
Ich möchte mittels einer .bat Datei die Codierung von UTF-8 in ANSI ändern.

Vielen Dank face-smile

Content-Key: 302765

Url: https://administrator.de/contentid/302765

Printed on: April 18, 2024 at 10:04 o'clock

Mitglied: 114757
Solution 114757 Apr 24, 2016 updated at 16:01:35 (UTC)
Goto Top
Moin.
@echo off
powershell -Executionpolicy ByPass -Command "gc 'C:\datei_utf8.txt' | set-content 'C:\datei_ansi.txt' -Encoding Default"  
Oder mit installiertem cygwin:
iconv -f utf-8 -t windows-1252 infile > outfile
Gruß jodel32
Member: pdiddo
pdiddo Apr 24, 2016 at 16:16:23 (UTC)
Goto Top
Vielen Dank for die rasche Antwort !Es klappt zwar sehr gut. Aber die Umlaute werden nun als '?' dargestellt...Das passiert nicht wenn man es manuell zu ansi umwandelt.
Ich habe die erste Antwort genutzt
Member: pdiddo
pdiddo Apr 24, 2016 at 16:20:21 (UTC)
Goto Top
Ok habs selber lösen können.

Statt in Zeile 1-Encoding Default funktioniert es mit -Encoding String

Danke nochmal jodel32 !!