sanex3339 před 9 roky
rodič
revize
3c696f72da
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 1 1
      dist/src/Utils.js
  2. 1 1
      src/Utils.ts

+ 1 - 1
dist/src/Utils.js

@@ -42,7 +42,7 @@ class Utils {
     }
     static stringToUnicode(string) {
         const radix = 16, unicodeSliceValue = -4;
-        let regexp = new RegExp('[a-zA-Z]');
+        let regexp = new RegExp('[\x00-\x7F]');
         return `'${string.replace(/[\s\S]/g, (escape) => {
             if (regexp.test(escape)) {
                 return '\\x' + escape.charCodeAt(0).toString(radix);

+ 1 - 1
src/Utils.ts

@@ -100,7 +100,7 @@ export class Utils {
         const radix: number = 16,
             unicodeSliceValue: number = -4;
 
-        let regexp: RegExp = new RegExp('[a-zA-Z]');
+        let regexp: RegExp = new RegExp('[\x00-\x7F]');
 
         return `'${string.replace(/[\s\S]/g, (escape: string): string => {
             if (regexp.test(escape)) {