I have a text file input.xlf
<trans-unit id="loco:5e7257a0c38e0f5b456bae94">
<source>Login</source>
<target>登入</target>
<note>Login Header</note>
</trans-unit>
Basically I need to replace <
with <
and >
with '>', so I run below script
runner.bat
powershell -Command "(gc input.xlf) -replace '<', '<' | Out-File -encoding ASCII output.xlf";
powershell -Command "(gc output.xlf) -replace '>', '>' | Out-File -encoding ASCII output.xlf";
The above was working until I noticed below as the output
<trans-unit id="loco:5e7257a0c38e0f5b456bae94">
<source>Login</source>
<target>??????</target>
<note>Login Header</note>
</trans-unit>
I tried removing the encoding but now I get
<trans-unit id="loco:5e7257a0c38e0f5b456bae94">
<source>Login</source>
<target>登入</target>
<note>Login Header</note>
</trans-unit>
Below is my desired output
<trans-unit id="loco:5e7257a0c38e0f5b456bae94">
<source>Login</source>
<target>登入</target>
<note>Login Header</note>
</trans-unit>