Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ namespace Kajabity.Tools.Java
public class JavaProperties: Hashtable
{
/// <summary>
/// Gets a reference to the ISO-8859-1 encoding (code page 28592). This is the Java standard for .properties files.
/// Gets a reference to the ISO-8859-1 encoding (code page 28591). This is the Java standard for .properties files.
/// </summary>
internal static Encoding DefaultEncoding { get { return Encoding.GetEncoding( 28592 ); } }
internal static Encoding DefaultEncoding { get { return Encoding.GetEncoding( 28591 ); } }

/// <summary>
/// A reference to an optional set of default properties - these values are returned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public void Parse( Stream stream )
public void Parse( Stream stream, Encoding encoding )
{
var bufferedStream = new BufferedStream( stream, bufferSize );
// the default encoding ISO-8859-1 (codepabe 28592) will be used if we do not pass explicitly different encoding
// the default encoding ISO-8859-1 (code page 28591) will be used if we do not pass explicitly different encoding
var parserEncoding = encoding ?? JavaProperties.DefaultEncoding;
reader = new BinaryReader( bufferedStream, parserEncoding );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ public JavaPropertyWriter( Hashtable hashtable )
/// <param name="comments">Optional comments that are placed at the beginning of the output.</param>
public void Write( Stream stream, string comments )
{
// Create a writer to output to an ISO-8859-1 encoding (code page 28592).
StreamWriter writer = new StreamWriter( stream, System.Text.Encoding.GetEncoding( 28592 ) );

//TODO: Confirm correct codepage:
// 28592 iso-8859-2 Central European (ISO)
// 28591 iso-8859-1 Western European (ISO)
// from http://msdn.microsoft.com/en-us/library/system.text.encodinginfo.getencoding.aspx
// Create a writer to output to an ISO-8859-1 encoding (code page 28591).
StreamWriter writer = new StreamWriter( stream, JavaProperties.DefaultEncoding );

if( comments != null)
{
Expand Down