From 1b6fe8580869883cb5da53740baac1e14ab79cd3 Mon Sep 17 00:00:00 2001 From: JamesNK Date: Sat, 10 Apr 2010 00:41:36 +0000 Subject: [PATCH] -Fix exception message spelling mistake --- Src/Newtonsoft.Json.Tests/JsonConvertTest.cs | 2 +- Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs | 2 +- Src/Newtonsoft.Json/JsonTextReader.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs b/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs index c4078950..750b100f 100644 --- a/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs @@ -257,7 +257,7 @@ now brown cow?", '"', true); } [Test] - [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "After parsing a value an unexpected character was encoutered: t. Line 1, position 20.")] + [ExpectedException(typeof(JsonReaderException), ExpectedMessage = "After parsing a value an unexpected character was encountered: t. Line 1, position 20.")] public void TestInvalidStrings() { string orig = @"this is a string ""that has quotes"" "; diff --git a/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs b/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs index 397702ca..a391e61e 100644 --- a/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs +++ b/Src/Newtonsoft.Json/Bson/BsonBinaryWriter.cs @@ -58,7 +58,7 @@ namespace Newtonsoft.Json.Bson foreach (BsonToken c in value) { _writer.Write((sbyte)c.Type); - WriteString(index.ToString(CultureInfo.InvariantCulture), Encoding.GetByteCount(index.ToString(CultureInfo.InvariantCulture)), null); + WriteString(index.ToString(CultureInfo.InvariantCulture), MathUtils.IntLength(index), null); WriteTokenInternal(c); index++; } diff --git a/Src/Newtonsoft.Json/JsonTextReader.cs b/Src/Newtonsoft.Json/JsonTextReader.cs index f61beff1..a9e36b5d 100644 --- a/Src/Newtonsoft.Json/JsonTextReader.cs +++ b/Src/Newtonsoft.Json/JsonTextReader.cs @@ -409,7 +409,7 @@ namespace Newtonsoft.Json } else { - throw CreateJsonReaderException("After parsing a value an unexpected character was encoutered: {0}. Line {1}, position {2}.", currentChar, _currentLineNumber, _currentLinePosition); + throw CreateJsonReaderException("After parsing a value an unexpected character was encountered: {0}. Line {1}, position {2}.", currentChar, _currentLineNumber, _currentLinePosition); } break; }