Skip to content

Commit

Permalink
Merge pull request #875 from maiko3tattun/1008_FixMapImport
Browse files Browse the repository at this point in the history
Fix import/export prefixmap
  • Loading branch information
stakira authored Oct 10, 2023
2 parents 6897d0e + 9c8d168 commit a57ae2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions OpenUtau/Views/EditSubbanksDialog.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
using Avalonia.Controls;
using Avalonia.Interactivity;
using OpenUtau.App.ViewModels;
Expand Down Expand Up @@ -70,7 +69,7 @@ async void OnImportMap(object sender, RoutedEventArgs args) {
var file = await FilePicker.OpenFile(this, "singers.subbanks.import", ViewModel.Singer.Location, FilePicker.PrefixMap);
if (!string.IsNullOrEmpty(file)) {
try {
using (var reader = new StreamReader(file, Encoding.GetEncoding("shift_jis"))) {
using (var reader = new StreamReader(file, ViewModel.Singer.TextFileEncoding)) {
while (reader.Peek() != -1) {
var line = reader.ReadLine()!.Trim();
var s = line.Split('\t');
Expand All @@ -97,7 +96,7 @@ async void OnExportMap(object sender, RoutedEventArgs args) {
var file = await FilePicker.SaveFile(this, "singers.subbanks.export", ViewModel.Singer.Location, "prefix.map", FilePicker.PrefixMap);
if (!string.IsNullOrEmpty(file)) {
try {
using (var writer = new StreamWriter(file, false, Encoding.GetEncoding("shift_jis"))) {
using (var writer = new StreamWriter(file, false, ViewModel.Singer.TextFileEncoding)) {
foreach (var row in main.Rows) {
writer.WriteLine($"{row.Tone}\t{row.Prefix}\t{row.Suffix}");
}
Expand Down

0 comments on commit a57ae2c

Please sign in to comment.