Fossil

Check-in [7d3a06b8]
Login

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

Overview
Comment:Add detection of binary data with no leading UTF-16 byte-order-mark.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | commitWarningV2
Files: files | file ages | folders
SHA1: 7d3a06b89a3998299d04a5fed7779f5583fd65b1
User & Date: mistachkin 2012-11-01 20:19:49
Context
2012-11-02
02:27
Merge commit warning and file content type detection changes to trunk. check-in: 0c7c6144 user: mistachkin tags: trunk
2012-11-01
20:19
Add detection of binary data with no leading UTF-16 byte-order-mark. Closed-Leaf check-in: 7d3a06b8 user: mistachkin tags: commitWarningV2
20:09
Improve detection of UTF-8, UTF-16, binary data, and carriage returns during commit operations. check-in: c837e444 user: mistachkin tags: commitWarningV2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
  char *zMsg;             /* Warning message */
  Blob fname;             /* Relative pathname of the file */
  static int allOk = 0;   /* Set to true to disable this routine */

  if( allOk ) return;
  fUnicode = starts_with_utf16_bom(p);
  eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
  if( eType==-1 || fUnicode ){
    const char *zWarning;
    Blob ans;
    char cReply;

    if( eType==-1 && fUnicode ){
      zWarning = "Unicode and CR/NL line endings";
    }else if( eType==-1 ){







|







893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
  char *zMsg;             /* Warning message */
  Blob fname;             /* Relative pathname of the file */
  static int allOk = 0;   /* Set to true to disable this routine */

  if( allOk ) return;
  fUnicode = starts_with_utf16_bom(p);
  eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
  if( eType==0 || eType==-1 || fUnicode ){
    const char *zWarning;
    Blob ans;
    char cReply;

    if( eType==-1 && fUnicode ){
      zWarning = "Unicode and CR/NL line endings";
    }else if( eType==-1 ){