var current_pos = 0;
var OUTPUT = "";
- function to_ascii(str) {
+ function to_ascii(str, identifier) {
return str.replace(/[\u0080-\uffff]/g, function(ch) {
var code = ch.charCodeAt(0).toString(16);
- if (code.length <= 2) {
+ if (code.length <= 2 && !identifier) {
while (code.length < 2) code = "0" + code;
return "\\x" + code;
} else {
function make_name(name) {
name = name.toString();
if (options.ascii_only)
- name = to_ascii(name);
+ name = to_ascii(name, true);
return name;
};