encoding - How to bencode non-ascii strings and non-integer numbers? -
according bencoding specification:
bencoded strings encoded follows:
<string length encoded in base ten ascii>:<string data>, orkey:valuenote there no constant beginning delimiter, , no ending delimiter.example: 4:spam represents string "spam"
example: 0: represents empty string ""integers encoded follows: i
<integer encoded in base ten ascii>e initial i , trailing e beginning , ending delimiters. can have negative numbers such i-3e. significant digits should used, 1 cannot pad integer zeroes. such i04e. however, i0e valid.example: i3e represents integer "3"
my questions:
question 1: how should bencode string non-ascii characters? example: mûrier or die höhe zeit shall convert such string sequence of bytes, using utf-8 encoding, or one? , how apply specification?
question 2: how bencode non-integer number, example 1.0002910 or -0.0049172?
- from spec, "all character string values utf-8 encoded."
- not covered spec; apparently not needed.
Comments
Post a Comment