pub enum TextEncoding {
Auto,
Utf8,
Utf16,
}Expand description
Used to indicate the preferred encoding for text columns.
Variants§
Auto
Evaluates to Self::Utf16 on windows and Self::Utf8 on other systems. We do this,
because most systems e.g. MacOs and Linux use UTF-8 as their default encoding, while windows
may still use a Latin1 or some other extended ASCII as their narrow encoding. On the other
hand many Posix drivers are lacking in their support for wide function calls and UTF-16. So
using Wide on windows and Narrow everythere else is a good starting point.
Utf8
Use narrow characters (one byte) to encode text in payloads. ODBC lets the client choose the encoding which should be based on the system local. This is often not what is actually happening though. If we use narrow encoding, we assume the text to be UTF-8 and error if we find that not to be the case.
Utf16
Use wide characters (two bytes) to encode text in payloads. ODBC defines the encoding to be always UTF-16.
Implementations§
Trait Implementations§
Source§impl Clone for TextEncoding
impl Clone for TextEncoding
Source§fn clone(&self) -> TextEncoding
fn clone(&self) -> TextEncoding
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more