Skip to main content
deleted 16 characters in body
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript (Node.js), 175172 bytes

([aa,b]b,x,y)=>eval('for(c=d=t=0;c-a||ba|b-d;[c,d]=x(p,q))y(p=++t>>8,q=t&255)')
S=(k,t)=>[128+k/2+k%2/2+64*(k>62),(k%2?63+(t>63):158)+t]
J=(k,t)=>[32+k,32+t]
E=(k,t)=>[160+k,160+t]

Try it online!Try it online!

Invoke as f([227227, 129]129, S, E) where S=Shift_JIS, E=EUC, J=JIS.

JavaScript (Node.js), 175 bytes

([a,b],x,y)=>eval('for(c=d=t=0;c-a||b-d;[c,d]=x(p,q))y(p=++t>>8,q=t&255)')
S=(k,t)=>[128+k/2+k%2/2+64*(k>62),(k%2?63+(t>63):158)+t]
J=(k,t)=>[32+k,32+t]
E=(k,t)=>[160+k,160+t]

Try it online!

Invoke as f([227, 129], S, E) where S=Shift_JIS, E=EUC, J=JIS.

JavaScript (Node.js), 172 bytes

(a,b,x,y)=>eval('for(c=d=t=0;c-a|b-d;[c,d]=x(p,q))y(p=++t>>8,q=t&255)')
S=(k,t)=>[128+k/2+k%2/2+64*(k>62),(k%2?63+(t>63):158)+t]
J=(k,t)=>[32+k,32+t]
E=(k,t)=>[160+k,160+t]

Try it online!

Invoke as f(227, 129, S, E) where S=Shift_JIS, E=EUC, J=JIS.

Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript (Node.js), 175 bytes

([a,b],x,y)=>eval('for(c=d=t=0;c-a||b-d;[c,d]=x(p,q))y(p=++t>>8,q=t&255)')
S=(k,t)=>[128+k/2+k%2/2+64*(k>62),(k%2?63+(t>63):158)+t]
J=(k,t)=>[32+k,32+t]
E=(k,t)=>[160+k,160+t]

Try it online!

Invoke as f([227, 129], S, E) where S=Shift_JIS, E=EUC, J=JIS.