I don't think this is generally the right thing to do here.  The conversion should be done just in the latex template rather than everywhere that might deal with the filename and expect a native path.