Skip to content

Commit 1959a1d

Browse files
committed
Improved PowerShell script for generating the UTF8 file for TextMeshPro
1 parent 1660fed commit 1959a1d

4 files changed

Lines changed: 144 additions & 623 deletions

File tree

Assets/DFTGames/Localization/Demo/Resources/localization/AllText.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
title My Great\nGame
2-
play Play
3-
opts Settings
4-
info Info
5-
title=Il mio grande\ngioco
6-
play=Gioca
7-
opts=Impostazioni
8-
info=Informazioni
9-
title=私の素晴らしい\nゲーム
10-
play=プレイ
11-
opts=オプション
12-
info=インフォ
131
title My Great\nGame
142
play Play
153
opts Settings
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
(gc -Encoding Utf8 *.txt) | out-file AllText.txt -encoding utf8
1+
$utf8NoBom = New-Object System.Text.UTF8Encoding($false) # $false => no BOM
2+
$outPath = "AllText.txt"
3+
4+
$sw = New-Object System.IO.StreamWriter($outPath, $false, $utf8NoBom)
5+
try {
6+
Get-ChildItem -Filter *.txt -File | ForEach-Object {
7+
Get-Content -LiteralPath $_.FullName -Encoding UTF8 | ForEach-Object {
8+
$sw.WriteLine($_)
9+
}
10+
}
11+
}
12+
finally {
13+
$sw.Dispose()
14+
}

0 commit comments

Comments
 (0)