Write a string tag.
(fid, kind, data)
| 129 | |
| 130 | |
| 131 | def write_string(fid, kind, data): |
| 132 | """Write a string tag.""" |
| 133 | try: |
| 134 | str_data = str(data).encode("latin1") |
| 135 | except UnicodeEncodeError: |
| 136 | str_data = str(data).encode("latin1", errors="xmlcharrefreplace") |
| 137 | data_size = len(str_data) # therefore compute size here |
| 138 | if data_size > 0: |
| 139 | _write(fid, str_data, kind, data_size, FIFF.FIFFT_STRING, ">S") |
| 140 | |
| 141 | |
| 142 | def write_name_list(fid, kind, data): |
no test coverage detected