mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
fix malformed utf-8: writeBytes just strips all but the last byte of multi-byte utf8 chars!
This commit is contained in:
parent
73a1083dff
commit
56ce5761d7
1 changed files with 4 additions and 2 deletions
|
@ -696,6 +696,7 @@ public class RelayService extends XWService
|
||||||
|
|
||||||
out.writeShort( BuildConstants.CLIENT_VERS_RELAY );
|
out.writeShort( BuildConstants.CLIENT_VERS_RELAY );
|
||||||
writeVLIString( out, BuildConstants.GIT_REV );
|
writeVLIString( out, BuildConstants.GIT_REV );
|
||||||
|
// writeVLIString( out, String.format( "€%s", Build.MODEL) );
|
||||||
writeVLIString( out, Build.MODEL );
|
writeVLIString( out, Build.MODEL );
|
||||||
writeVLIString( out, Build.VERSION.RELEASE );
|
writeVLIString( out, Build.VERSION.RELEASE );
|
||||||
|
|
||||||
|
@ -1152,9 +1153,10 @@ public class RelayService extends XWService
|
||||||
if ( null == str ) {
|
if ( null == str ) {
|
||||||
str = "";
|
str = "";
|
||||||
}
|
}
|
||||||
int len = str.length();
|
byte[] bytes = str.getBytes( "UTF-8" );
|
||||||
|
int len = bytes.length;
|
||||||
un2vli( len, os );
|
un2vli( len, os );
|
||||||
os.writeBytes( str );
|
os.write( bytes, 0, len );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMaxIntervalSeconds( int maxIntervalSeconds )
|
private void setMaxIntervalSeconds( int maxIntervalSeconds )
|
||||||
|
|
Loading…
Reference in a new issue