mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 10:44:07 +02:00
entity utf8 fixes?
This commit is contained in:
parent
14c93cb157
commit
d11d90c8e6
4 changed files with 16 additions and 2 deletions
|
|
@ -500,6 +500,10 @@ impl Packfile {
|
|||
};
|
||||
result
|
||||
}
|
||||
|
||||
pub fn into_zip(self) -> Mutex<ZipArchive<Cursor<Vec<u8>>>> {
|
||||
self.zip
|
||||
}
|
||||
}
|
||||
|
||||
fn try_read_enum<Enum, Reader, Error, ErrorFn>(
|
||||
|
|
|
|||
|
|
@ -28,8 +28,9 @@ impl<'a> LumpReader<Cursor<Cow<'a, [u8]>>> {
|
|||
|
||||
impl<R: BinReaderExt + Read> LumpReader<R> {
|
||||
pub fn read_entities(&mut self) -> BspResult<Entities> {
|
||||
let mut entities = String::with_capacity(self.length);
|
||||
self.inner.read_to_string(&mut entities)?;
|
||||
let mut data: Vec<u8> = Vec::with_capacity(self.length);
|
||||
self.inner.read_exact(&mut data)?;
|
||||
let entities = String::from_utf8(data).map_err(|e| StringError::from(e.utf8_error()))?;
|
||||
Ok(Entities { entities })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue