programming and technology thread (130)

1 Name: Anonymous : 2021-07-04 17:36 ID:Heaven

When /tech/ is too slow for you

45 Name: Anonymous : 2021-11-19 06:24 ID:Heaven

Damn, /nihongo/ threads like
(;;・m・) わたしわにほんごがわかりません。
save for me like
(;;�Em�E) �킽����ɂق񂲂��킩��܂���B

/nihongo/ board has Content-Type: text/html;charset=shift_jis , while almost every other board has it as text/html;charset=utf-8. And things break when I do AJAX like things from one board to another

xmlhttp.onreadystatechange = function() {

if (this.readyState == 4 && this.status == 200) {
var page = document.createElement('div')
page.innerHTML = xmlhttp.responseText.split(/<body[^>]*>((?:.|\n|\r)*)<\/body>/i)[1]
//alert(page.innerHTML)
page = document.evaluate('//*[@id="oldthreadlist"]', page, null, 9, null).singleNodeValue
katalog_parse(board, page)
}

}

46 Name: Anonymous : 2021-11-19 07:32 ID:Heaven

Tried doing
var shift_jis = new TextDecoder("shift_jis")
var utf8 = new TextEncoder("utf-8")
response = shift_jis.decode(utf8.encode(response))
...didn't work.

I need a way to get binary data instead of string out of XMLHttpRequest
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: