Skip to content

Instantly share code, notes, and snippets.

@sters
Last active December 29, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sters/7714457 to your computer and use it in GitHub Desktop.
Save sters/7714457 to your computer and use it in GitHub Desktop.
✌('ω'✌ )三✌('ω')✌三( ✌'ω')✌
// usage:
//
// search(encodeURIComponent)
//
// or Other encode / escape function
//
function search(encodeFunc) {
for(var i=0; i<65536; i++) {
try {
var str = String.fromCharCode(i);
var encoded = encodeFunc(str);
if (str === encoded) {
console.log("Index:", i, " String:", str);
}
} catch(e) {
console.log("Index: ", i, " String: Error");
}
}
}
@sters
Copy link
Author

sters commented Nov 30, 2013

へんなののこってたのでけしました

@sters
Copy link
Author

sters commented Nov 30, 2013

// chrome 31.0.1650.57 m, encodeURIComponent
Index: 33 String: !
Index: 39 String: '
Index: 40 String: (
Index: 41 String: )
Index: 42 String: *
Index: 45 String: -
Index: 46 String: .
Index: 48 String: 0
Index: 49 String: 1
Index: 50 String: 2
Index: 51 String: 3
Index: 52 String: 4
Index: 53 String: 5
Index: 54 String: 6
Index: 55 String: 7
Index: 56 String: 8
Index: 57 String: 9
Index: 65 String: A
Index: 66 String: B
Index: 67 String: C
Index: 68 String: D
Index: 69 String: E
Index: 70 String: F
Index: 71 String: G
Index: 72 String: H
Index: 73 String: I
Index: 74 String: J
Index: 75 String: K
Index: 76 String: L
Index: 77 String: M
Index: 78 String: N
Index: 79 String: O
Index: 80 String: P
Index: 81 String: Q
Index: 82 String: R
Index: 83 String: S
Index: 84 String: T
Index: 85 String: U
Index: 86 String: V
Index: 87 String: W
Index: 88 String: X
Index: 89 String: Y
Index: 90 String: Z
Index: 95 String: _
Index: 97 String: a
Index: 98 String: b
Index: 99 String: c
Index: 100 String: d
Index: 101 String: e
Index: 102 String: f
Index: 103 String: g
Index: 104 String: h
Index: 105 String: i
Index: 106 String: j
Index: 107 String: k
Index: 108 String: l
Index: 109 String: m
Index: 110 String: n
Index: 111 String: o
Index: 112 String: p
Index: 113 String: q
Index: 114 String: r
Index: 115 String: s
Index: 116 String: t
Index: 117 String: u
Index: 118 String: v
Index: 119 String: w
Index: 120 String: x
Index: 121 String: y
Index: 122 String: z
Index: 126 String: ~

Index: 55296~ Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment