LanguageBaseItemGetEncoding Method

Gets an Encoding appropriate for this language base item.

Definition

Namespace: InTheHand.Net.Bluetooth.AttributeIds
Assembly: InTheHand.Net.Bluetooth (in InTheHand.Net.Bluetooth.dll) Version: 4.0.32+5cdf1cfd21064ea31c5de33d160200ca1c4bc218
C#
public Encoding GetEncoding()

Return Value

Encoding
The Encoding appropriate for this language base item.

Remarks

We support the following set of mappings from encoding id to .NET Encoding name.

IdEncoding
3us-ascii
4iso-8859-1
5iso-8859-2
6iso-8859-3
7iso-8859-4
8iso-8859-5
9iso-8859-6
10iso-8859-7
11iso-8859-8
12iso-8859-9
13iso-8859-10
106 (0x006a)UTF-8
109iso-8859-13
110iso-8859-14
111iso-8859-15
112iso-8859-16
1013 (0x03f5)unicodeFFFE (UTF-16BE)
1014utf-16 (UTF-16LE)
1015utf-16 (UTF-16, we assume UTF16-LE)
2252 to 2258 (0x08cc to 0x08d2)windows-1252 to Windows-1258
Note that not all platforms support all these Encodings, for instance on my Windows XP SP2 box iso-8859-10/-14/-16 are not supported. On NETCF on Windows Mobile 5 only five of the ISO-8859 encodings are supported. Regardless I've seen no SDP records that use ISO-8859 encodings so this is not a problem, most records actually use UTF-8.

Exceptions

NotSupportedException The IETF encoding id for this language base item is currently unknown. If valid, add it to the s_IetfCharsetIdToDotNetEncodingNameTable table, providing a mapping to its Windows code page name.

See Also