Skip to content

Commit

Permalink
temporary fix for utf8 diff bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
revflash committed May 24, 2016
1 parent 9560db0 commit e82c01e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,8 @@ state database_api::get_state( string path )const
} catch ( const fc::exception& e ) {
_state.error = e.to_detail_string();
}
idump((_state)(fc::json::to_string(_state).size()));
idump((fc::is_utf8( fc::json::to_string(_state)) ));
return _state;
}

Expand Down
5 changes: 4 additions & 1 deletion libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ void comment_evaluator::do_apply( const comment_operation& o )
auto patch = dmp.patch_fromText( o.body );
if( patch.size() ) {
auto result = dmp.patch_apply( patch, com.body );
com.body = result.first;
if( !fc::is_utf8( result.first ) ) {
idump(("invalid utf8")(result.first));
com.body = fc::prune_invalid_utf8(result.first);
} else { com.body = result.first; }
}
else { // replace
com.body = o.body;
Expand Down
2 changes: 1 addition & 1 deletion libraries/fc

0 comments on commit e82c01e

Please sign in to comment.