What Encoding Does Mac Use For Text Files

To read a text file with non ASCII encoding. Mac Linux), use. The problem is that the basic R functions for reading and writing data from and to files does no.

-->

Definition

Inheritance
EncodingEncodingEncodingEncoding
Derived
ASCIIEncodingASCIIEncodingASCIIEncodingASCIIEncoding
UnicodeEncodingUnicodeEncodingUnicodeEncodingUnicodeEncoding
UTF32EncodingUTF32EncodingUTF32EncodingUTF32Encoding
UTF8EncodingUTF8EncodingUTF8EncodingUTF8Encoding
Attributes
Implements
ICloneableICloneableICloneableICloneable

Examples

The following example converts a string from one encoding to another.

Note

The byte[] array is the only type in this example that contains the encoded data. The .NET Char and String types are themselves Unicode, so the GetChars call decodes the data back to Unicode.

Remarks

Encoding is the process of transforming a set of Unicode characters into a sequence of bytes. In contrast, decoding is the process of transforming a sequence of encoded bytes into a set of Unicode characters. For information about the Unicode Transformation Formats (UTFs) and other encodings supported by Encoding, see Character Encoding in .NET.

Note that Encoding is intended to operate on Unicode characters instead of arbitrary binary data, such as byte arrays. If you must encode arbitrary binary data into text, you should use a protocol such as uuencode, which is implemented by methods such as Convert.ToBase64CharArray.

What Encoding Does Mac Use For Text Files

.NET provides the following implementations of the Encoding class to support current Unicode encodings and other encodings:

  • ASCIIEncoding encodes Unicode characters as single 7-bit ASCII characters. This encoding only supports character values between U+0000 and U+007F. Code page 20127. Also available through the ASCII property.

  • UTF7Encoding encodes Unicode characters using the UTF-7 encoding. This encoding supports all Unicode character values. Code page 65000. Also available through the UTF7 property.

  • UTF8Encoding encodes Unicode characters using the UTF-8 encoding. This encoding supports all Unicode character values. Code page 65001. Also available through the UTF8 property.

  • UnicodeEncoding encodes Unicode characters using the UTF-16 encoding. Both little endian and big endian byte orders are supported. Also available through the Unicode property and the BigEndianUnicode property.

  • UTF32Encoding encodes Unicode characters using the UTF-32 encoding. Both little endian (code page 12000) and big endian (code page 12001) byte orders are supported. Also available through the UTF32 property.

The Encoding class is primarily intended to convert between different encodings and Unicode. Often one of the derived Unicode classes is the correct choice for your app.

Use the GetEncoding method to obtain other encodings, and call the GetEncodings method to get a list of all encodings.

The following table lists the encodings supported by .NET Framework and .NET Core. It lists each encoding's code page number and the values of the encoding's EncodingInfo.Name and EncodingInfo.DisplayName properties. A check mark in the .NET Framework support and .NET Core support columns indicates that the code page is natively supported by that .NET implementation, regardless of the underlying platform. For .NET Framework, the availability of other encodings listed in the table depends on the operating system. For .NET Core, other encodings are available by using the System.Text.CodePagesEncodingProvider class or by deriving from the System.Text.EncodingProvider class.

Note

Code pages whose EncodingInfo.Name property corresponds to an international standard do not necessarily comply in full with that standard.

Code pageNameDisplay name.NET Framework support.NET Core support
37IBM037IBM EBCDIC (US-Canada)
437IBM437OEM United States
500IBM500IBM EBCDIC (International)
708ASMO-708Arabic (ASMO 708)
720DOS-720Arabic (DOS)
737ibm737Greek (DOS)
775ibm775Baltic (DOS)
850ibm850Western European (DOS)
852ibm852Central European (DOS)
855IBM855OEM Cyrillic
857ibm857Turkish (DOS)
858IBM00858OEM Multilingual Latin I
860IBM860Portuguese (DOS)
861ibm861Icelandic (DOS)
862DOS-862Hebrew (DOS)
863IBM863French Canadian (DOS)
864IBM864Arabic (864)
865IBM865Nordic (DOS)
866cp866Cyrillic (DOS)
869ibm869Greek, Modern (DOS)
870IBM870IBM EBCDIC (Multilingual Latin-2)
874windows-874Thai (Windows)
875cp875IBM EBCDIC (Greek Modern)
932shift_jisJapanese (Shift-JIS)
936gb2312Chinese Simplified (GB2312)
949ks_c_5601-1987Korean
950big5Chinese Traditional (Big5)
1026IBM1026IBM EBCDIC (Turkish Latin-5)
1047IBM01047IBM Latin-1
1140IBM01140IBM EBCDIC (US-Canada-Euro)
1141IBM01141IBM EBCDIC (Germany-Euro)
1142IBM01142IBM EBCDIC (Denmark-Norway-Euro)
1143IBM01143IBM EBCDIC (Finland-Sweden-Euro)
1144IBM01144IBM EBCDIC (Italy-Euro)
1145IBM01145IBM EBCDIC (Spain-Euro)
1146IBM01146IBM EBCDIC (UK-Euro)
1147IBM01147IBM EBCDIC (France-Euro)
1148IBM01148IBM EBCDIC (International-Euro)
1149IBM01149IBM EBCDIC (Icelandic-Euro)
1200utf-16Unicode
1201unicodeFFFEUnicode (Big endian)
1250windows-1250Central European (Windows)
1251windows-1251Cyrillic (Windows)
1252Windows-1252Western European (Windows)
1253windows-1253Greek (Windows)
1254windows-1254Turkish (Windows)
1255windows-1255Hebrew (Windows)
1256windows-1256Arabic (Windows)
1257windows-1257Baltic (Windows)
1258windows-1258Vietnamese (Windows)
1361JohabKorean (Johab)
10000macintoshWestern European (Mac)
10001x-mac-japaneseJapanese (Mac)
10002x-mac-chinesetradChinese Traditional (Mac)
10003x-mac-koreanKorean (Mac)
10004x-mac-arabicArabic (Mac)
10005x-mac-hebrewHebrew (Mac)
10006x-mac-greekGreek (Mac)
10007x-mac-cyrillicCyrillic (Mac)
10008x-mac-chinesesimpChinese Simplified (Mac)
10010x-mac-romanianRomanian (Mac)
10017x-mac-ukrainianUkrainian (Mac)
10021x-mac-thaiThai (Mac)
10029x-mac-ceCentral European (Mac)
10079x-mac-icelandicIcelandic (Mac)
10081x-mac-turkishTurkish (Mac)
10082x-mac-croatianCroatian (Mac)
12000utf-32Unicode (UTF-32)
12001utf-32BEUnicode (UTF-32 Big endian)
20000x-Chinese-CNSChinese Traditional (CNS)
20001x-cp20001TCA Taiwan
20002x-Chinese-EtenChinese Traditional (Eten)
20003x-cp20003IBM5550 Taiwan
20004x-cp20004TeleText Taiwan
20005x-cp20005Wang Taiwan
20105x-IA5Western European (IA5)
20106x-IA5-GermanGerman (IA5)
20107x-IA5-SwedishSwedish (IA5)
20108x-IA5-NorwegianNorwegian (IA5)
20127us-asciiUS-ASCII
20261x-cp20261T.61
20269x-cp20269ISO-6937
20273IBM273IBM EBCDIC (Germany)
20277IBM277IBM EBCDIC (Denmark-Norway)
20278IBM278IBM EBCDIC (Finland-Sweden)
20280IBM280IBM EBCDIC (Italy)
20284IBM284IBM EBCDIC (Spain)
20285IBM285IBM EBCDIC (UK)
20290IBM290IBM EBCDIC (Japanese katakana)
20297IBM297IBM EBCDIC (France)
20420IBM420IBM EBCDIC (Arabic)
20423IBM423IBM EBCDIC (Greek)
20424IBM424IBM EBCDIC (Hebrew)
20833x-EBCDIC-KoreanExtendedIBM EBCDIC (Korean Extended)
20838IBM-ThaiIBM EBCDIC (Thai)
20866koi8-rCyrillic (KOI8-R)
20871IBM871IBM EBCDIC (Icelandic)
20880IBM880IBM EBCDIC (Cyrillic Russian)
20905IBM905IBM EBCDIC (Turkish)
20924IBM00924IBM Latin-1
20932EUC-JPJapanese (JIS 0208-1990 and 0212-1990)
20936x-cp20936Chinese Simplified (GB2312-80)
20949x-cp20949Korean Wansung
21025cp1025IBM EBCDIC (Cyrillic Serbian-Bulgarian)
21866koi8-uCyrillic (KOI8-U)
28591iso-8859-1Western European (ISO)
28592iso-8859-2Central European (ISO)
28593iso-8859-3Latin 3 (ISO)
28594iso-8859-4Baltic (ISO)
28595iso-8859-5Cyrillic (ISO)
28596iso-8859-6Arabic (ISO)
28597iso-8859-7Greek (ISO)
28598iso-8859-8Hebrew (ISO-Visual)
28599iso-8859-9Turkish (ISO)
28603iso-8859-13Estonian (ISO)
28605iso-8859-15Latin 9 (ISO)
29001x-EuropaEuropa
38598iso-8859-8-iHebrew (ISO-Logical)
50220iso-2022-jpJapanese (JIS)
50221csISO2022JPJapanese (JIS-Allow 1 byte Kana)
50222iso-2022-jpJapanese (JIS-Allow 1 byte Kana - SO/SI)
50225iso-2022-krKorean (ISO)
50227x-cp50227Chinese Simplified (ISO-2022)
51932euc-jpJapanese (EUC)
51936EUC-CNChinese Simplified (EUC)
51949euc-krKorean (EUC)
52936hz-gb-2312Chinese Simplified (HZ)
54936GB18030Chinese Simplified (GB18030)
57002x-iscii-deISCII Devanagari
57003x-iscii-beISCII Bengali
57004x-iscii-taISCII Tamil
57005x-iscii-teISCII Telugu
57006x-iscii-asISCII Assamese
57007x-iscii-orISCII Oriya
57008x-iscii-kaISCII Kannada
57009x-iscii-maISCII Malayalam
57010x-iscii-guISCII Gujarati
57011x-iscii-paISCII Punjabi
65000utf-7Unicode (UTF-7)
65001utf-8Unicode (UTF-8)

The following example calls the GetEncoding(Int32) and GetEncoding(String) methods to get the Greek (Windows) code page encoding. It compares the Encoding objects returned by the method calls to show that they are equal, and then maps displays the Unicode code point and the corresponding code page value for each character in the Greek alphabet.

If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, you should use the Decoder or the Encoder provided by the GetDecoder method or the GetEncoder method, respectively, of a derived class.

The UTF-16 and the UTF-32 encoders can use the big endian byte order (most significant byte first) or the little endian byte order (least significant byte first). For example, the Latin Capital Letter A (U+0041) is serialized as follows (in hexadecimal):

  • UTF-16 big endian byte order: 00 41

  • UTF-16 little endian byte order: 41 00

  • UTF-32 big endian byte order: 00 00 00 41

  • UTF-32 little endian byte order: 41 00 00 00

It is generally more efficient to store Unicode characters using the native byte order. For example, it is better to use the little endian byte order on little endian platforms, such as Intel computers.

The GetPreamble method retrieves an array of bytes that includes the byte order mark (BOM). If this byte array is prefixed to an encoded stream, it helps the decoder to identify the encoding format used.

For more information on byte order and the byte order mark, see The Unicode Standard at the Unicode home page.

Note that the encoding classes allow errors to:

  • Silently change to a '?' character.

  • Use a 'best fit' character.

  • Change to an application-specific behavior through use of the EncoderFallback and DecoderFallback classes with the U+FFFD Unicode replacement character.

You should throw an exception on any data stream error. An app either uses a 'throwonerror' flag when applicable or uses the EncoderExceptionFallback and DecoderExceptionFallback classes. Best fit fallback is often not recommended because it can cause data loss or confusion and is slower than simple character replacements. For ANSI encodings, the best fit behavior is the default.

Constructors

Encoding()Encoding()Encoding()Encoding()

Initializes a new instance of the Encoding class.

Encoding(Int32)Encoding(Int32)Encoding(Int32)Encoding(Int32)

Initializes a new instance of the Encoding class that corresponds to the specified code page.

Encoding(Int32, EncoderFallback, DecoderFallback)Encoding(Int32, EncoderFallback, DecoderFallback)Encoding(Int32, EncoderFallback, DecoderFallback)Encoding(Int32, EncoderFallback, DecoderFallback)

Initializes a new instance of the Encoding class that corresponds to the specified code page with the specified encoder and decoder fallback strategies.

Properties

ASCIIASCIIASCIIASCII

Gets an encoding for the ASCII (7-bit) character set.

BigEndianUnicodeBigEndianUnicodeBigEndianUnicodeBigEndianUnicode

Gets an encoding for the UTF-16 format that uses the big endian byte order.

BodyNameBodyNameBodyNameBodyName

When overridden in a derived class, gets a name for the current encoding that can be used with mail agent body tags.

CodePageCodePageCodePageCodePage

When overridden in a derived class, gets the code page identifier of the current Encoding.

DecoderFallbackDecoderFallbackDecoderFallbackDecoderFallback

Gets or sets the DecoderFallback object for the current Encoding object.

DefaultDefaultDefaultDefault

Gets the default encoding for this .NET implementation.

EncoderFallbackEncoderFallbackEncoderFallbackEncoderFallback

Gets or sets the EncoderFallback object for the current Encoding object.

EncodingNameEncodingNameEncodingNameEncodingName

When overridden in a derived class, gets the human-readable description of the current encoding.

HeaderNameHeaderNameHeaderNameHeaderName

When overridden in a derived class, gets a name for the current encoding that can be used with mail agent header tags.

IsBrowserDisplayIsBrowserDisplayIsBrowserDisplayIsBrowserDisplay

When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for displaying content.

IsBrowserSaveIsBrowserSaveIsBrowserSaveIsBrowserSave

When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for saving content.

IsMailNewsDisplayIsMailNewsDisplayIsMailNewsDisplayIsMailNewsDisplay

When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.

IsMailNewsSaveIsMailNewsSaveIsMailNewsSaveIsMailNewsSave

When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for saving content.

IsReadOnlyIsReadOnlyIsReadOnlyIsReadOnly

When overridden in a derived class, gets a value indicating whether the current encoding is read-only.

IsSingleByteIsSingleByteIsSingleByteIsSingleByte

When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points.

PreamblePreamblePreamblePreamble
UnicodeUnicodeUnicodeUnicode

Gets an encoding for the UTF-16 format using the little endian byte order.

UTF32UTF32UTF32UTF32

Gets an encoding for the UTF-32 format using the little endian byte order.

UTF7UTF7UTF7UTF7

Gets an encoding for the UTF-7 format.

UTF8UTF8UTF8UTF8

Gets an encoding for the UTF-8 format.

WebNameWebNameWebNameWebName

When overridden in a derived class, gets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding.

WindowsCodePageWindowsCodePageWindowsCodePageWindowsCodePage

When overridden in a derived class, gets the Windows operating system code page that most closely corresponds to the current encoding.

Methods

Clone()Clone()Clone()Clone()

When overridden in a derived class, creates a shallow copy of the current Encoding object.

Convert(Encoding, Encoding, Byte[])Convert(Encoding, Encoding, Byte[])Convert(Encoding, Encoding, Byte[])Convert(Encoding, Encoding, Byte[])

Converts an entire byte array from one encoding to another.

Convert(Encoding, Encoding, Byte[], Int32, Int32)Convert(Encoding, Encoding, Byte[], Int32, Int32)Convert(Encoding, Encoding, Byte[], Int32, Int32)Convert(Encoding, Encoding, Byte[], Int32, Int32)

Converts a range of bytes in a byte array from one encoding to another.

Equals(Object)Equals(Object)Equals(Object)Equals(Object)

Determines whether the specified Object is equal to the current instance.

GetByteCount(Char*, Int32)GetByteCount(Char*, Int32)GetByteCount(Char*, Int32)GetByteCount(Char*, Int32)

When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer.

GetByteCount(Char[])GetByteCount(Char[])GetByteCount(Char[])GetByteCount(Char[])

When overridden in a derived class, calculates the number of bytes produced by encoding all the characters in the specified character array.

GetByteCount(Char[], Int32, Int32)GetByteCount(Char[], Int32, Int32)GetByteCount(Char[], Int32, Int32)GetByteCount(Char[], Int32, Int32)

When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.

GetByteCount(ReadOnlySpan<Char>)GetByteCount(ReadOnlySpan<Char>)GetByteCount(ReadOnlySpan<Char>)GetByteCount(ReadOnlySpan<Char>)
GetByteCount(String)GetByteCount(String)GetByteCount(String)GetByteCount(String)

When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string.

GetByteCount(String, Int32, Int32)GetByteCount(String, Int32, Int32)GetByteCount(String, Int32, Int32)GetByteCount(String, Int32, Int32)
GetBytes(Char*, Int32, Byte*, Int32)GetBytes(Char*, Int32, Byte*, Int32)GetBytes(Char*, Int32, Byte*, Int32)GetBytes(Char*, Int32, Byte*, Int32)

When overridden in a derived class, encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer.

GetBytes(Char[])GetBytes(Char[])GetBytes(Char[])GetBytes(Char[])

When overridden in a derived class, encodes all the characters in the specified character array into a sequence of bytes.

GetBytes(Char[], Int32, Int32)GetBytes(Char[], Int32, Int32)GetBytes(Char[], Int32, Int32)GetBytes(Char[], Int32, Int32)

When overridden in a derived class, encodes a set of characters from the specified character array into a sequence of bytes.

GetBytes(Char[], Int32, Int32, Byte[], Int32)GetBytes(Char[], Int32, Int32, Byte[], Int32)GetBytes(Char[], Int32, Int32, Byte[], Int32)GetBytes(Char[], Int32, Int32, Byte[], Int32)

When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array.

GetBytes(ReadOnlySpan<Char>, Span<Byte>)GetBytes(ReadOnlySpan<Char>, Span<Byte>)GetBytes(ReadOnlySpan<Char>, Span<Byte>)GetBytes(ReadOnlySpan<Char>, Span<Byte>)
GetBytes(String)GetBytes(String)GetBytes(String)GetBytes(String)

When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.

GetBytes(String, Int32, Int32)GetBytes(String, Int32, Int32)GetBytes(String, Int32, Int32)GetBytes(String, Int32, Int32)
GetBytes(String, Int32, Int32, Byte[], Int32)GetBytes(String, Int32, Int32, Byte[], Int32)GetBytes(String, Int32, Int32, Byte[], Int32)GetBytes(String, Int32, Int32, Byte[], Int32)

When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array.

GetCharCount(Byte*, Int32)GetCharCount(Byte*, Int32)GetCharCount(Byte*, Int32)GetCharCount(Byte*, Int32)

When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer.

GetCharCount(Byte[])GetCharCount(Byte[])GetCharCount(Byte[])GetCharCount(Byte[])

When overridden in a derived class, calculates the number of characters produced by decoding all the bytes in the specified byte array.

GetCharCount(Byte[], Int32, Int32)GetCharCount(Byte[], Int32, Int32)GetCharCount(Byte[], Int32, Int32)GetCharCount(Byte[], Int32, Int32)

When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.

GetCharCount(ReadOnlySpan<Byte>)GetCharCount(ReadOnlySpan<Byte>)GetCharCount(ReadOnlySpan<Byte>)GetCharCount(ReadOnlySpan<Byte>)
GetChars(Byte*, Int32, Char*, Int32)GetChars(Byte*, Int32, Char*, Int32)GetChars(Byte*, Int32, Char*, Int32)GetChars(Byte*, Int32, Char*, Int32)

When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer.

GetChars(Byte[])GetChars(Byte[])GetChars(Byte[])GetChars(Byte[])

When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters.

GetChars(Byte[], Int32, Int32)GetChars(Byte[], Int32, Int32)GetChars(Byte[], Int32, Int32)GetChars(Byte[], Int32, Int32)

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters.

GetChars(Byte[], Int32, Int32, Char[], Int32)GetChars(Byte[], Int32, Int32, Char[], Int32)GetChars(Byte[], Int32, Int32, Char[], Int32)GetChars(Byte[], Int32, Int32, Char[], Int32)

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array.

GetChars(ReadOnlySpan<Byte>, Span<Char>)GetChars(ReadOnlySpan<Byte>, Span<Char>)GetChars(ReadOnlySpan<Byte>, Span<Char>)GetChars(ReadOnlySpan<Byte>, Span<Char>)
GetDecoder()GetDecoder()GetDecoder()GetDecoder()

When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters.

GetEncoder()GetEncoder()GetEncoder()GetEncoder()

When overridden in a derived class, obtains an encoder that converts a sequence of Unicode characters into an encoded sequence of bytes.

GetEncoding(Int32)GetEncoding(Int32)GetEncoding(Int32)GetEncoding(Int32)

Returns the encoding associated with the specified code page identifier.

GetEncoding(Int32, EncoderFallback, DecoderFallback)GetEncoding(Int32, EncoderFallback, DecoderFallback)GetEncoding(Int32, EncoderFallback, DecoderFallback)GetEncoding(Int32, EncoderFallback, DecoderFallback)

Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.

GetEncoding(String)GetEncoding(String)GetEncoding(String)GetEncoding(String)

Returns the encoding associated with the specified code page name.

GetEncoding(String, EncoderFallback, DecoderFallback)GetEncoding(String, EncoderFallback, DecoderFallback)GetEncoding(String, EncoderFallback, DecoderFallback)GetEncoding(String, EncoderFallback, DecoderFallback)

Returns the encoding associated with the specified code page name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.

GetEncodings()GetEncodings()GetEncodings()GetEncodings()

Returns an array that contains all encodings.

GetHashCode()GetHashCode()GetHashCode()GetHashCode()

Returns the hash code for the current instance.

GetMaxByteCount(Int32)GetMaxByteCount(Int32)GetMaxByteCount(Int32)GetMaxByteCount(Int32)

When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters.

GetMaxCharCount(Int32)GetMaxCharCount(Int32)GetMaxCharCount(Int32)GetMaxCharCount(Int32)

When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes.

GetPreamble()GetPreamble()GetPreamble()GetPreamble()

When overridden in a derived class, returns a sequence of bytes that specifies the encoding used.

GetString(Byte*, Int32)GetString(Byte*, Int32)GetString(Byte*, Int32)GetString(Byte*, Int32)

When overridden in a derived class, decodes a specified number of bytes starting at a specified address into a string.

GetString(Byte[])GetString(Byte[])GetString(Byte[])GetString(Byte[])

When overridden in a derived class, decodes all the bytes in the specified byte array into a string.

GetString(Byte[], Int32, Int32)GetString(Byte[], Int32, Int32)GetString(Byte[], Int32, Int32)GetString(Byte[], Int32, Int32)

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a string.

GetString(ReadOnlySpan<Byte>)GetString(ReadOnlySpan<Byte>)GetString(ReadOnlySpan<Byte>)GetString(ReadOnlySpan<Byte>)
GetType()GetType()GetType()GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsAlwaysNormalized()IsAlwaysNormalized()IsAlwaysNormalized()IsAlwaysNormalized()

Gets a value indicating whether the current encoding is always normalized, using the default normalization form.

IsAlwaysNormalized(NormalizationForm)IsAlwaysNormalized(NormalizationForm)IsAlwaysNormalized(NormalizationForm)IsAlwaysNormalized(NormalizationForm)

When overridden in a derived class, gets a value indicating whether the current encoding is always normalized, using the specified normalization form.

MemberwiseClone()MemberwiseClone()MemberwiseClone()MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterProvider(EncodingProvider)RegisterProvider(EncodingProvider)RegisterProvider(EncodingProvider)RegisterProvider(EncodingProvider)

Registers an encoding provider.

ToString()ToString()ToString()ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also

Active2 years, 9 months ago

Is it possible to set the default encoding for Excel (any version, e.g. 2010) when opening files like csv files (like you can in Open Office Calc)?

I When I try to open a csv file encoded in Japanese SHIFT-JIS, it opens but with mojibake (corrupted characters). In Open Office Calc, if you click on a csv file with a non-standard encoding like SHIFT-JIS, it automatically opens a dialog where you can set the encoding.

lozzer
lozzerlozzer

5 Answers

Use the import function under 'Data' tab where Excel allows us to specify the encoding. Select 'from text' and choose your csv file then Select Japanese shift-jis encoding.

prpprp

The following steps work with Office 2003.

  1. Rename .csv to .txt
  2. Open .txt file from Excel (don't do it with right click on file then open with Excel), Excel will open a Text Import Wizard dialog, ask ask for the format of .txt file, including character encoding of text file.
  3. Rename .txt back to .csv after your edit is finished.

What Encoding Does Mac Use For Text Files To Excel

LiuYan 刘研LiuYan 刘研
1,5742 gold badges14 silver badges29 bronze badges

On Excel 2016 for Mac:

  1. create blank worksheet,
  2. in main menu go to Data ->Get External Data ->Import Text File,
  3. follow steps in wizard - choose the encoding until you will see the correct preview and on the next step choose columns delimiter (delimiters differ from csv to csv files).
DaddyMDaddyM

What Encoding Does Mac Use For Text Files Examples

See if this helps (MS Excel 2007 and above).

  1. Open Excel and click the MicrosoftOrb at the top and then click onExcel Options.

  2. Go to Advanced, and then lookfor the Web Options button. Itshould be under General.

  3. Go to the Encoding tab and pickJapanese Shift-JIS from the drop-down menu. Click Ok,restart Excel and try to open yourfile.

EllesaEllesa
8,9342 gold badges31 silver badges46 bronze badges

Lozzer provided great feedback in the small print: 'If I set the default editing language to Japanese, then the SHIFT-JIS csv file will open correctly....'

I have spent hours looking for a solution on how to open Japanese CSV with one simple clickWe have a multi-language environment (En-Jp).

Even though Excel showed Japanese menus (based on the control panels language settings), the default editing setting in File > Options > Language > Choose Editing Language (Top area) remained English. Changing that to Japanese (obviously no issue for Japanese users) solved our problem.

TFMWhat encoding does mac use for text files python

What Encoding Does Mac Use For Text Files Python

4,2182 gold badges27 silver badges37 bronze badges
MattyMatty

What Encoding Does Mac Use For Text Files

protected by bwDracoNov 16 '16 at 5:46

What Encoding Does Mac Use For Text Files Not Formatted

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged microsoft-excelcsvcharacter-encodingcharactersshift-jis or ask your own question.