我在Pytesseract的屏幕截图上运行了大量的OCR。这在大多数情况下运行良好,但是少数导致此错误:
var mongoose = require('mongoose'),
mongooseDelete = require('mongoose-delete'),
Schema = mongoose.Schema;
var MySchema = new Schema({
name: {type: String, required: true}
});
MySchema.plugin(mongooseDelete, {deletedAt: true, deletedBy: true});
MySchema.pre('find', function (next){
// I want to add {deleted: false} to the queries conditions
});
我正在使用Python 3.4。任何建议我如何防止这种错误发生(除了一个尝试/除外)将是非常有帮助的。
答案 0 :(得分:0)
确保使用正确的解码选项 见https://docs.python.org/3/library/codecs.html#standard-encodings
str.decode(' UTF-8')
bytes.decode(' cp950')繁体中文等