// I now used assembler. In the visual basic code the same was done with ugly mathasm// <- Nibble swap! We swap the last four // bits with the first four: 00101111 -> 11110010ror TempChar,4end;

// Some chars need to be replaced with a string like "/%DCN005%/"If (TempChar =0) or (TempChar =5) or (TempChar =36) or (TempChar =96)or (TempChar =124) or (TempChar =126)thenresult:=result+'/%DCN'+ ByteToThreeCharStr(TempChar) +'%/'elseresult:=result+chr (TempChar);end;end;