|
|
@@ -44,20 +44,9 @@ package haxe;
|
|
|
return content.copy();
|
|
|
}
|
|
|
|
|
|
- private static function unescapeName( name : String ) : String
|
|
|
- {
|
|
|
- var regex = ~/-x([0-9]+)/g;
|
|
|
- return regex.map(name, function(regex) return String.fromCharCode(Std.parseInt(regex.matched(1))));
|
|
|
- }
|
|
|
-
|
|
|
- private static function escapeName( name : String ) : String
|
|
|
- {
|
|
|
- var regex = ~/[^A-Za-z0-9_\/]/g;
|
|
|
- return regex.map(name, function(v) return '-x' + v.matched(0).charCodeAt(0));
|
|
|
- }
|
|
|
-
|
|
|
+ @:access(haxe.io.Path.escape)
|
|
|
public static function getString( name : String ) : String {
|
|
|
- name = escapeName(name);
|
|
|
+ name = haxe.io.Path.escape(name, true);
|
|
|
var path = getPaths().get(name);
|
|
|
var str = cs.Lib.toNativeType(haxe.Resource).Assembly.GetManifestResourceStream(path);
|
|
|
if (str != null)
|
|
|
@@ -65,8 +54,9 @@ package haxe;
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @:access(haxe.io.Path.escape)
|
|
|
public static function getBytes( name : String ) : haxe.io.Bytes {
|
|
|
- name = escapeName(name);
|
|
|
+ name = haxe.io.Path.escape(name, true);
|
|
|
var path = getPaths().get(name);
|
|
|
var str = cs.Lib.toNativeType(haxe.Resource).Assembly.GetManifestResourceStream(path);
|
|
|
if (str != null)
|