Fossil

Check-in [87da6f97]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix corner-case in invalid utf-8 detection, with modified test-cases. Additional test-cases still to be done.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:87da6f97d7863f90dc8cb75413508a3ee1bf3aa8
User & Date: jan.nijtmans 2016-06-10 10:23:16
Context
2016-06-10
11:49
Add many test-cases of (possible) invalid UTF-8 sequences check-in: acf7fe47 user: jan.nijtmans tags: trunk
10:23
Fix corner-case in invalid utf-8 detection, with modified test-cases. Additional test-cases still to be done. check-in: 87da6f97 user: jan.nijtmans tags: trunk
2016-06-09
15:26
Add mimetypes for bz2 and bzip. check-in: c7e9625d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/lookslike.c.

159
160
161
162
163
164
165
166










167
168
169
170
171
172
173
    c2 = c;
    c = *++z;
    if( c2>=0x80 ){
      if( ((c2<0xc2) || (c2>=0xf4) || ((c&0xc0)!=0x80)) &&
          (((c2!=0xf4) || (c>=0x90)) && ((c2!=0xc0) || (c!=0x80))) ){
        return LOOK_INVALID; /* Invalid UTF-8 */
      }
      c = (c2 >= 0xe0) ? (c2<<1)+1 : ' ';










    }
  }
  return (c>=0x80) ? LOOK_INVALID : 0; /* Last byte must be ASCII. */
}


/*







|
>
>
>
>
>
>
>
>
>
>







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
    c2 = c;
    c = *++z;
    if( c2>=0x80 ){
      if( ((c2<0xc2) || (c2>=0xf4) || ((c&0xc0)!=0x80)) &&
          (((c2!=0xf4) || (c>=0x90)) && ((c2!=0xc0) || (c!=0x80))) ){
        return LOOK_INVALID; /* Invalid UTF-8 */
      }
      if( c2>=0xe0 ){
        if( c2>=0xf0 ){
          if (c2==0xf0 && c<0x90) return LOOK_INVALID; /* Invalid UTF-8 */
          c = (c2<<1)|3;
        }else{
          if (c2==0xe0 && c<0xa0) return LOOK_INVALID; /* Invalid UTF-8 */
          c = (c2<<1)|3;
        }
      }else{
        c = ' ';
      }
    }
  }
  return (c>=0x80) ? LOOK_INVALID : 0; /* Last byte must be ASCII. */
}


/*

Changes to test/utf.test.

5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
....
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
....
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
....
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
....
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
....
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
....
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
....
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
.....
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
.....
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
.....
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
.....
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
.....
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
.....
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
.....
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
.....
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 407 utf-check-407-0-153-1.jnk \
{File "%TEMP%/utf-check-407-0-153-1.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 408 utf-check-408-0-154-0.jnk \
{File "%TEMP%/utf-check-408-0-154-0.jnk" has 5 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 409 utf-check-409-0-154-1.jnk \
{File "%TEMP%/utf-check-409-0-154-1.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 410 utf-check-410-0-155-0.jnk \
{File "%TEMP%/utf-check-410-0-155-0.jnk" has 5 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 411 utf-check-411-0-155-1.jnk \
{File "%TEMP%/utf-check-411-0-155-1.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 412 utf-check-412-0-156-0.jnk \
{File "%TEMP%/utf-check-412-0-156-0.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 413 utf-check-413-0-156-1.jnk \
{File "%TEMP%/utf-check-413-0-156-1.jnk" has 7 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 414 utf-check-414-0-157-0.jnk \
{File "%TEMP%/utf-check-414-0-157-0.jnk" has 3 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 769 utf-check-769-1-153-1.jnk \
{File "%TEMP%/utf-check-769-1-153-1.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 770 utf-check-770-1-154-0.jnk \
{File "%TEMP%/utf-check-770-1-154-0.jnk" has 8 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 771 utf-check-771-1-154-1.jnk \
{File "%TEMP%/utf-check-771-1-154-1.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 772 utf-check-772-1-155-0.jnk \
{File "%TEMP%/utf-check-772-1-155-0.jnk" has 8 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 773 utf-check-773-1-155-1.jnk \
{File "%TEMP%/utf-check-773-1-155-1.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 774 utf-check-774-1-156-0.jnk \
{File "%TEMP%/utf-check-774-1-156-0.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 775 utf-check-775-1-156-1.jnk \
{File "%TEMP%/utf-check-775-1-156-1.jnk" has 10 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: no
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 776 utf-check-776-1-157-0.jnk \
{File "%TEMP%/utf-check-776-1-157-0.jnk" has 6 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
....
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
....
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
....
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
....
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
....
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
....
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
....
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
.....
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
.....
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
.....
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
.....
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
.....
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
.....
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
.....
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
.....
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 407 utf-check-407-0-153-1.jnk \
{File "%TEMP%/utf-check-407-0-153-1.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 408 utf-check-408-0-154-0.jnk \
{File "%TEMP%/utf-check-408-0-154-0.jnk" has 5 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 409 utf-check-409-0-154-1.jnk \
{File "%TEMP%/utf-check-409-0-154-1.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 410 utf-check-410-0-155-0.jnk \
{File "%TEMP%/utf-check-410-0-155-0.jnk" has 5 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 411 utf-check-411-0-155-1.jnk \
{File "%TEMP%/utf-check-411-0-155-1.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 412 utf-check-412-0-156-0.jnk \
{File "%TEMP%/utf-check-412-0-156-0.jnk" has 6 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 413 utf-check-413-0-156-1.jnk \
{File "%TEMP%/utf-check-413-0-156-1.jnk" has 7 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 414 utf-check-414-0-157-0.jnk \
{File "%TEMP%/utf-check-414-0-157-0.jnk" has 3 bytes.
Starts with UTF-8 BOM: no
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 769 utf-check-769-1-153-1.jnk \
{File "%TEMP%/utf-check-769-1-153-1.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: yes
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 770 utf-check-770-1-154-0.jnk \
{File "%TEMP%/utf-check-770-1-154-0.jnk" has 8 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 771 utf-check-771-1-154-1.jnk \
{File "%TEMP%/utf-check-771-1-154-1.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: yes
Has flag LOOK_LF: no
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 772 utf-check-772-1-155-0.jnk \
{File "%TEMP%/utf-check-772-1-155-0.jnk" has 8 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 773 utf-check-773-1-155-1.jnk \
{File "%TEMP%/utf-check-773-1-155-1.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: no
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: yes
Has flag LOOK_CRLF: no
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 774 utf-check-774-1-156-0.jnk \
{File "%TEMP%/utf-check-774-1-156-0.jnk" has 9 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 775 utf-check-775-1-156-1.jnk \
{File "%TEMP%/utf-check-775-1-156-1.jnk" has 10 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no
................................................................................
Has flag LOOK_NUL: no
Has flag LOOK_CR: yes
Has flag LOOK_LONE_CR: no
Has flag LOOK_LF: yes
Has flag LOOK_LONE_LF: no
Has flag LOOK_CRLF: yes
Has flag LOOK_LONG: no
Has flag LOOK_INVALID: yes
Has flag LOOK_ODD: no
Has flag LOOK_SHORT: no}

utf-check 776 utf-check-776-1-157-0.jnk \
{File "%TEMP%/utf-check-776-1-157-0.jnk" has 6 bytes.
Starts with UTF-8 BOM: yes
Starts with UTF-16 BOM: no