groue / GRMustache.swift

Flexible Mustache templates for Swift
http://mustache.github.com/
MIT License
594 stars 155 forks source link

handle file and directory name include white space #85

Closed fumito-ito closed 1 year ago

fumito-ito commented 1 year ago

fixes #72 and ref: #50

Mustache.swift calls URL(string:) when constructing file path. But it causes some crashes when the file name contains white space.

Generally, URL(fileURLWithPath:) is used to solve such problems, but this API is not available in Mustache.swift because it supports iOS 9+. Therefore, encode the URL path to be added beforehand to work around the problem.