diff options
author | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
commit | 916e3bf886ee622e2f18d6eb74f90fee8c630471 (patch) | |
tree | 69f9a6d2a7f7041966400f56f46c198f2cc06158 /OpenSim/Framework/Util.cs | |
parent | Fix build break for windows with missing package for IScriptEngine in prebuil... (diff) | |
download | opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.zip opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.gz opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.bz2 opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.xz |
Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than constructing fresh copies.
The encodings are thread-safe and already used in such a manner in other places.
This isn't done where Byte Order Mark output is suppressed, since Encoding.UTF8 is constructed to output the BOM.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e03bb74..fd9586c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1236,8 +1236,7 @@ namespace OpenSim.Framework | |||
1236 | 1236 | ||
1237 | public static string Base64ToString(string str) | 1237 | public static string Base64ToString(string str) |
1238 | { | 1238 | { |
1239 | UTF8Encoding encoder = new UTF8Encoding(); | 1239 | Decoder utf8Decode = Encoding.UTF8.GetDecoder(); |
1240 | Decoder utf8Decode = encoder.GetDecoder(); | ||
1241 | 1240 | ||
1242 | byte[] todecode_byte = Convert.FromBase64String(str); | 1241 | byte[] todecode_byte = Convert.FromBase64String(str); |
1243 | int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); | 1242 | int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); |