File tree Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -77,28 +77,21 @@ public static KVObject Parse(BinaryReader reader)
7777 }
7878 }
7979
80- // TODO: Correct this to produce correct wide string results
8180 private static string ReadString ( BinaryReader reader , byte width = 1 )
8281 {
83- StringBuilder builder = new StringBuilder ( ) ;
84- byte [ ] current = new byte [ width ] ;
82+ var buffer = new List < byte > ( ) ;
83+ byte [ ] current ;
8584
8685 while ( true )
8786 {
88- for ( int i = 0 ; i < width ; ++ i )
89- {
90- current [ i ] = reader . ReadByte ( ) ;
91- }
87+ current = reader . ReadBytes ( width ) ;
9288 if ( current . All ( val => val == 0 ) )
93- {
9489 break ;
95- }
9690 foreach ( var c in current )
97- {
98- builder . Append ( ( char ) c ) ;
99- }
91+ buffer . Add ( c ) ;
10092 }
101- return builder . ToString ( ) ;
93+ return ( width == 1 ? Encoding . UTF8 : Encoding . Unicode )
94+ . GetString ( buffer . ToArray ( ) ) ;
10295 }
10396 }
10497}
Original file line number Diff line number Diff line change 66[ assembly: AssemblyDescription ( "Parses and displays info about Steam .vdf files" ) ]
77[ assembly: AssemblyCopyright ( "© Grub4K 2021" ) ]
88
9- [ assembly: AssemblyVersion ( "2.2 " ) ]
10- [ assembly: AssemblyInformationalVersion ( "2.2 " ) ]
11- [ assembly: AssemblyFileVersion ( "2.2.0 .0" ) ]
9+ [ assembly: AssemblyVersion ( "2.3 " ) ]
10+ [ assembly: AssemblyInformationalVersion ( "2.3 " ) ]
11+ [ assembly: AssemblyFileVersion ( "2.3.2 .0" ) ]
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ static partial class Program
1515 {
1616 static int Main ( string [ ] args )
1717 {
18+ Console . OutputEncoding = Encoding . UTF8 ;
1819 switch ( args . ElementAtOrDefault ( 0 ) ) {
1920 case "-v" :
2021 case "--version" :
You can’t perform that action at this time.
0 commit comments