[corlib] Add partial EncodingHelper type to let XI define its own default encoding...
[mono.git] / mcs / class / corlib / System.Text / EncodingHelper.MonoTouch.cs
1 using System;
2
3 namespace System.Text {
4
5         internal static partial class EncodingHelper {
6
7                 static volatile Encoding utf8Encoding;
8
9                 internal static Encoding UTF8 {
10                         get {
11                                 if (utf8Encoding == null) {
12                                         lock (lockobj){
13                                                 if (utf8Encoding == null){
14                                                         utf8Encoding = new UTF8Encoding (true, false);
15                                                         utf8Encoding.setReadOnly ();
16                                                 }
17                                         }
18                                 }
19
20                                 return utf8Encoding;
21                         }
22                 }
23
24                 // The mobile profile has been default'ing to UTF8 since it's creation
25                 internal static Encoding GetDefaultEncoding ()
26                 {
27                         return UTF8;
28                 }
29         }
30 }