Ryan O'Hara

Canada

Age: 18

If you don’t use code formatting for emphasis, we can probably be friends.

1d
awarded Enlightened
1d
awarded Nice Answer
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
Okay, the JSON is wrong. Your server should be producing "\u00b7".
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
@Michael: Chat might be better at this point: chat.stackoverflow.com/rooms/102419/question-35167234
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
@Michael: Please show your code.
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
@Michael: Automatically gets rendered as · by what? Does "\xc2\xb7" represent the two bytes c2 b7 or is it a JavaScript string literal representing the four bytes c3 82 c2 b7? Check things with curl.
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
@Michael: How did you try “setting a JavaScript string to that”? decodeURIComponent('%C2%B7') === '·'.
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
That sounds unusual. Could you show some code? Also, assuming that the test for outputting some fixed UTF-8-encoded text works, make sure whatever’s responsible for decoding request parameters is interpreting as and producing UTF-8.
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
@Musa: OP should want the correct encoding :)
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
Be sure to use encodeURIComponent instead of escape, too.
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
@Michael: %C2%B7 is the correct UTF-8, and you also have to make sure you’re actually writing UTF-8 as output. Try finding which point is breaking things by changing your server to write back a fixed UTF-8 string first.
Feb
3
comment How to correctly send/receive Unicode in XMLHttpRequest
charCodeAt() returns UTF-16 shorts, so you would only see one value for anything that’s only encoded as two bytes in UTF-16 (which · is). The correct way to handle this is to make all parts accept UTF-8.
Feb
3
awarded Good Answer
Feb
2
comment Explain how basic code is working - Eloquent JavaScript book
en.wikipedia.org/wiki/Binary_number
Feb
2
revised Explain how basic code is working - Eloquent JavaScript book
Actually that’s JavaScript
Feb
2
answered Object is not null and not undefined. What is better - double inversion `!!` or strict equillity `!==` in JavaScript
Feb
1
answered What is the best way to write readable code using promises?
Feb
1
revised Calculating the area of overlap of two functions
HTTPS image
Jan
31
comment Efficient design to search for objects by multiple parameters with range
Having lots of lists doesn’t make something non-generic. The approach you were considering sounds promising, so go ahead and implement it; not everything is built-in.
Jan
30
comment Sample attack scenarios on file downloads over HTTP
I would ask the answerer about that; it doesn’t seem to be backed up by anything.
1 2 3 4 5