(cls, store, count)
| 321 | |
| 322 | @classmethod |
| 323 | def read_string(cls, store, count): |
| 324 | string = b'' |
| 325 | while True: |
| 326 | char = cls.read_char(store, count=1) |
| 327 | if len(char) == 0 or char == b'\x00': |
| 328 | # read until '\0' |
| 329 | break |
| 330 | string += char |
| 331 | # We decode as UTF-8 by default and avoid errors with a replacement. |
| 332 | # UTF-8 should be the standard for RPMs, though for older rpms mileage |
| 333 | # may vary |
| 334 | return string and string.decode('utf-8', errors='replace') or None |
| 335 | |
| 336 | @classmethod |
| 337 | def read_string_array(cls, store, count): |
no test coverage detected