Skip to main content

Encoding

Enum Encoding 

Source
#[repr(u64)]
pub enum Encoding {
Show 23 variants ASCII = 1, NEXTSTEP = 2, JapaneseEUC = 3, UTF8 = 4, ISOLatin1 = 5, Symbol = 6, NonLossyASCII = 7, ShiftJIS = 8, ISOLatin2 = 9, Unicode = 10, WindowsCP1251 = 11, WindowsCP1252 = 12, WindowsCP1253 = 13, WindowsCP1254 = 14, WindowsCP1250 = 15, ISO2022JP = 21, MacOSRoman = 30, UTF16BigEndian = 2_415_919_360, UTF16LittleEndian = 2_483_028_224, UTF32 = 2_348_810_496, UTF32BigEndian = 2_550_137_088, UTF32LittleEndian = 2_617_245_952, Proprietary = 65_536,
}
Expand description

The following constants are provided by NSString as possible string encodings.

Variants§

§

ASCII = 1

Strict 7-bit ASCII encoding within 8-bit chars; ASCII values 0…127 only.

§

NEXTSTEP = 2

8-bit ASCII encoding with NEXTSTEP extensions.

§

JapaneseEUC = 3

8-bit EUC encoding for Japanese text.

§

UTF8 = 4

An 8-bit representation of Unicode characters, suitable for transmission or storage by ASCII-based systems.

§

ISOLatin1 = 5

8-bit ISO Latin 1 encoding.

§

Symbol = 6

8-bit Adobe Symbol encoding vector.

§

NonLossyASCII = 7

7-bit verbose ASCII to represent all Unicode characters.

§

ShiftJIS = 8

8-bit Shift-JIS encoding for Japanese text.

§

ISOLatin2 = 9

8-bit ISO Latin 2 encoding.

§

Unicode = 10

The canonical Unicode encoding for string objects.

§

WindowsCP1251 = 11

Microsoft Windows codepage 1251, encoding Cyrillic characters; equivalent to AdobeStandardCyrillic font encoding.

§

WindowsCP1252 = 12

Microsoft Windows codepage 1252; equivalent to WinLatin1.

§

WindowsCP1253 = 13

Microsoft Windows codepage 1253, encoding Greek characters.

§

WindowsCP1254 = 14

Microsoft Windows codepage 1254, encoding Turkish characters.

§

WindowsCP1250 = 15

Microsoft Windows codepage 1250; equivalent to WinLatin2.

§

ISO2022JP = 21

ISO 2022 Japanese encoding for email.

§

MacOSRoman = 30

Classic Macintosh Roman encoding.

§

UTF16BigEndian = 2_415_919_360

UTF16 encoding with explicit endianness specified.

§

UTF16LittleEndian = 2_483_028_224

UTF16 encoding with explicit endianness specified.

§

UTF32 = 2_348_810_496

32-bit UTF encoding.

§

UTF32BigEndian = 2_550_137_088

UTF32 encoding with explicit endianness specified.

§

UTF32LittleEndian = 2_617_245_952

UTF32 encoding with explicit endianness specified.

§

Proprietary = 65_536

👎Deprecated:

This encoding has been deprecated—there is no replacement.

Installation-specific encoding.

Implementations§

Source§

impl Encoding

Source

pub const UTF16: Self = Encoding::Unicode

An alias for Unicode.

Trait Implementations§

Source§

impl Clone for Encoding

Source§

fn clone(&self) -> Encoding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Encoding

Source§

impl Debug for Encoding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Encoding

Source§

impl Hash for Encoding

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Encoding

Source§

fn eq(&self, other: &Encoding) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Encoding

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.