twain / twain-dsm

TWAIN Data Source Manager
140 stars 55 forks source link

twain.h contains non ASCII dash #1

Closed pkl97 closed 7 years ago

pkl97 commented 7 years ago

Line 2235 in twain.h looks like this:

#pragma option -a.

The dash "-" is however not the ASCII character 0x2d but the special CP1252 dash 0x96 (Unicode Character U+2013, see http://www.fileformat.info/info/unicode/char/2013/index.htm). I am quite sure that the Borland compiler for which this code was written, expects the ASCII dash (see http://docwiki.embarcadero.com/RADStudio/Seattle/en/Pragma_option). In line 198 of twain.h ("#pragma option -a2") the ASCII variant is used.

The "file" command shows that twain.h is not an ASCII file:

[user@host]$ file ./twain-dsm/TWAIN_DSM/src/twain.h ./twain-dsm/TWAIN_DSM/src/twain.h: Non-ISO extended-ASCII text, with CRLF line terminators

The hex dump with xxd shows the dash is 0x96 instead of 0x2d:

[user@host]$ xxd ./twain-dsm/TWAIN_DSM/src/twain.h

...
0013740: 2023 7072 6167 6d61 206f 7074 696f 6e20   #pragma option
0013750: 9661 2e0d 0a23 656e 6469 660d 0a0d 0a23  .a...#endif....#
0013760: 656e 6469 6620 202f 2a20 5457 4149 4e20  endif  /* TWAIN

The presence of this dash makes newer Microsoft Compilers complain if option /utf-8 is in use. Maybe someone can replace this dash with its ASCII counterpart.

mlmcl62 commented 7 years ago

No doubt about it, I need to check the issues tab more often. This is fixed now...