]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add Info "name.utf-8" field
authorMatt Joiner <anacrolix@gmail.com>
Thu, 17 Mar 2022 03:59:36 +0000 (14:59 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 17 Mar 2022 03:59:36 +0000 (14:59 +1100)
Comes up frequently with non-English torrents

metainfo/info.go

index c907f492df311f3dace7589b0a83a93d4d9af513..a5011946f335d7dae8dc83e6560b46015c4294f3 100644 (file)
@@ -13,9 +13,10 @@ import (
 
 // The info dictionary.
 type Info struct {
-       PieceLength int64  `bencode:"piece length"`      // BEP3
-       Pieces      []byte `bencode:"pieces"`            // BEP3
-       Name        string `bencode:"name"`              // BEP3
+       PieceLength int64  `bencode:"piece length"` // BEP3
+       Pieces      []byte `bencode:"pieces"`       // BEP3
+       Name        string `bencode:"name"`         // BEP3
+       NameUtf8    string `bencode:"name.utf-8,omitempty"`
        Length      int64  `bencode:"length,omitempty"`  // BEP3, mutually exclusive with Files
        Private     *bool  `bencode:"private,omitempty"` // BEP27
        // TODO: Document this field.