As you guessed, your problem is that with mIRC 7.x, the parameters passed to the /echo command are handled internally with utf8 and indeed it's a problem, you can't do it char by char but you can prevent the display problem by replacing invalid characters by a dot like you did, just add the tab in the /echo:

Code:
alias hexdump {
  if ($1 == -plaintext) bset -t &smdebvar 1 what you see here is some very nice and tasty $&
    conventional plaintext
  elseif ($1 == -randbinary) {
    bset &smdebvar 1 144 202 199 14 14 24 254 137 46 177 211 136 241 232 156 182 243 40 65 64 $&
      27 150 61 209 220 217 241 145 168 2 189 137 43 22 241 137 219 191 5 205 177 2 74 159 14 81 $&
      141 164 119 195 209 109 235 27 72 254 40 246 194 237 48 47 172 185 11 157 61 254 59 109 $&
      181 28 152 244 245 113 15 87 136 14 93 238 150 124 145 123 29 140 162 204 22 120 53 111 38 $&
      14 178 182 7 239 93 164 46 97 139 128 106 24 158 252 144 122 151 101 170 159 226 125 69 42 $&
      114 4 208 26 130 182 241 69 115 162 39 116 138 92 76 142 96 135 204 226 180 59 35 104 233 $&
      223 84 213 254 65 204 128 164 71 61 129 232 113 17 163 127 254 191 16 86 1 40 223 104 89 2 $&
      160 174 68 243 150 170 232 121 227 98 90 104 102 179 17 79
    bset &smdebvar 188 31 53 180 189 192 13 235 28 205 37 156 180 183 84 239 65 250 231 35 135 $&
      211 39 128 211 211 127 135 24 17 60 75 45 30 135 60 231 189 255 192 208 90 126 116 145 19 $&
      79 185 70 116 169 40 207 75 118 143 16 3 231 29 191 29 111 62 237 229 82 60 65 62 185 247 $&
      163 184 106 152 172 178 63 6 18 225 92 71 73 76 66 205 119 46 176 139 255 64 4 212 126 237 $&
      184 13 195 89 203 67 92 19 203 176 168 23 126 18 151 115 88 247 240 129 139 212 83 145 42 $&
      41 160 81 172 8 1 165 240 239 254 142 12 205 220 127 60 252 49 52 87 190 21 182 255 10 85 $&
      42 125 244 78 255 248 46 70 226 147 110 218 138 151 41 115 115 199 64 63 214 24 97 176 157 $&
      49 105 75 57 140 143 187 138 116 47 60 16 161 235 95 86 26 209 235 168 41 102 76 99 159 $&
      107 53 15 124 229 212
    bset &smdebvar 392 178 210 202 246 46 54 77 250 237 14 121 87 139 8 94 145 80 216 69 191 $&
      107 237 102 84 168 151 106 195 176 95 158 176 149 12 50 185 62 48 111 147 189 136 4 250 $&
      216 9 165 26 219 162 178 249 203 15 208 55 127 62 243 128 125 124 36 39 4 114 110 107 63 $&
      172 70 150 202 68 46 55 185 59 119 44 202 115 40 204 116 192 225 124 253 250 115 58 184 $&
      250 64 120 90 210 25 89 65 121 208 122 94 75 129 98 9 26 89 80 58 70 72 92 68 45 240 24 81 230
  }
  else return
  
  window -CDkz -t18 @hexdump -1 -1 1175 -1 Terminal 12
  var %maincount = 1
  while (%maincount <= $bvar(&smdebvar,0)) {
    bcopy -c &smdebvarline 1 &smdebvar %maincount 16
    var %hexcount = 1,%result
    while ($bvar(&smdebvarline,%hexcount,1)) {
      if ($v1 !isnum 32-127) bset &smdebvarline %hexcount 46
      %result = %result $base($v1,10,16,2)
      inc %hexcount
    }
    aline @hexdump $+($bvar(&smdebvarline,1-).text,$chr(9),%result)
    inc %maincount 16
  }
}

Last edited by Wims; 06/04/12 04:51 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel