Class StringCodec
Utility class for resolving the encoding used for reading and writing strings
Inheritance
System.Object
StringCodec
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
Fields
|
Improve this Doc
View Source
UnicodeZipEncoding
Returns the UTF-8 code page (65001) used for zip entries with unicode flag set
Declaration
public static readonly Encoding UnicodeZipEncoding
Field Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
ZipSpecCodePage
The non-unicode code page that should be used according to the zip specification
Declaration
public const int ZipSpecCodePage = 437
Field Value
Type |
Description |
System.Int32 |
|
Properties
|
Improve this Doc
View Source
CodePage
Declaration
public int CodePage { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Default
Creates a StringCodec that uses the system default encoder or UTF-8 depending on whether the zip entry Unicode flag is set
Declaration
public static StringCodec Default { get; }
Property Value
|
Improve this Doc
View Source
DefaultZipCryptoEncoding
The default encoding used for ZipCrypto passwords in zip files, set to SystemDefaultEncoding
for greatest compability.
Declaration
public static Encoding DefaultZipCryptoEncoding { get; }
Property Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
ForceZipLegacyEncoding
If set, use the encoding set by CodePage for zip entries instead of the defaults
Declaration
public bool ForceZipLegacyEncoding { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LegacyEncoding
Code page encoding, used for non-unicode strings
Declaration
public Encoding LegacyEncoding { get; }
Property Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
SystemDefaultCodePage
Operating system default codepage.
Declaration
public static int SystemDefaultCodePage { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
SystemDefaultEncoding
The system default encoding.
Declaration
public static Encoding SystemDefaultEncoding { get; }
Property Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
The encoding used for the zip archive comment. Defaults to the encoding for CodePage, since
no unicode flag can be set for it in the files.
Declaration
public Encoding ZipArchiveCommentEncoding { get; }
Property Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
ZipCryptoEncoding
Declaration
public Encoding ZipCryptoEncoding { get; }
Property Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
ZipOutputEncoding
Declaration
public Encoding ZipOutputEncoding { get; }
Property Value
Type |
Description |
System.Text.Encoding |
|
Methods
|
Improve this Doc
View Source
FromCodePage(Int32)
Creates a StringCodec that uses an encoding from the specified code page except for zip entries with the Unicode flag
Declaration
public static StringCodec FromCodePage(int codePage)
Parameters
Type |
Name |
Description |
System.Int32 |
codePage |
|
Returns
|
Improve this Doc
View Source
FromEncoding(Encoding)
Creates a StringCodec that uses an the specified encoding, except for zip entries with the Unicode flag
Declaration
public static StringCodec FromEncoding(Encoding encoding)
Parameters
Type |
Name |
Description |
System.Text.Encoding |
encoding |
|
Returns
|
Improve this Doc
View Source
WithForcedLegacyEncoding()
Create a copy of this StringCodec that ignores the Unicode flag when reading entries
Declaration
public StringCodec WithForcedLegacyEncoding()
Returns
|
Improve this Doc
View Source
WithStrictSpecEncoding()
Creates a StringCodec that uses the zip specification encoder or UTF-8 depending on whether the zip entry Unicode flag is set
Declaration
public static StringCodec WithStrictSpecEncoding()
Returns
|
Improve this Doc
View Source
Create a copy of this StringCodec with the specified zip archive comment encoding
Declaration
public StringCodec WithZipArchiveCommentEncoding(Encoding commentEncoding)
Parameters
Type |
Name |
Description |
System.Text.Encoding |
commentEncoding |
|
Returns
|
Improve this Doc
View Source
WithZipCryptoEncoding(Encoding)
Create a copy of this StringCodec with the specified zip crypto password encoding
Declaration
public StringCodec WithZipCryptoEncoding(Encoding cryptoEncoding)
Parameters
Type |
Name |
Description |
System.Text.Encoding |
cryptoEncoding |
|
Returns
|
Improve this Doc
View Source
ZipEncoding(Boolean)
Declaration
public Encoding ZipEncoding(bool unicode)
Parameters
Type |
Name |
Description |
System.Boolean |
unicode |
|
Returns
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
Declaration
public Encoding ZipInputEncoding(GeneralBitFlags flags)
Parameters
Returns
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
Declaration
public Encoding ZipInputEncoding(int flags)
Parameters
Type |
Name |
Description |
System.Int32 |
flags |
|
Returns
Type |
Description |
System.Text.Encoding |
|