Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-996

ERROR Unable to translate bytes at index N from specified code page to Unicode.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.8.3
    • Component/s: API, BSON
    • None
    • Environment:
      Mongo DB version : 2.6.1
      OS : Windows 8

      We have faced with following exception trying to read from DB, and we can not reproduce it once more. All read\write operations to Mongo DB are perfomed with C# MongoDB driver 1.8.3, Mongo DB version : 2.6.1.

      ERROR Unable to translate bytes [AB] at index 106 from specified code page to Unicode.
      Exception: System.Text.DecoderFallbackException
      Message: Unable to translate bytes [AB] at index 106 from specified code page to Unicode.
      Source: mscorlib
      at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index)
      at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index)
      at System.Text.DecoderFallbackBuffer.InternalFallback(Byte[] bytes, Byte* pBytes)
      at System.Text.UTF8Encoding.GetCharCount(Byte* bytes, Int32 count, DecoderNLS baseDecoder)
      at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
      at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
      at MongoDB.Bson.IO.BsonBuffer.DecodeUtf8String(UTF8Encoding encoding, Byte[] buffer, Int32 index, Int32 count)
      at MongoDB.Bson.IO.BsonBuffer.ReadString(UTF8Encoding encoding)
      at MongoDB.Bson.IO.BsonBinaryReader.ReadString()
      at MongoDB.Bson.Serialization.Serializers.BsonStringSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonValueSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonDocumentSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Driver.Internal.MongoReplyMessage`1.ReadFrom(BsonBuffer buffer, IBsonSerializationOptions serializationOptions)
      at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializer serializer, IBsonSerializationOptions serializationOptions)
      at MongoDB.Driver.Operations.QueryOperation`1.GetFirstBatch(IConnectionProvider connectionProvider)
      at MongoDB.Driver.Operations.QueryOperation`1.<Execute>d__0.MoveNext()
      at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
      at MongoDB.Driver.MongoCollection.FindOneAs[TDocument](IMongoQuery query)
      at MongoDB.Driver.MongoCollection.FindOneByIdAs[TDocument](BsonValue id)

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            maximvsidorenko Maxim Sidorenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: