On the other side looks like it's just a:

```ruby
filepath = path.gsub(/\0/, '')
```