Fossil

Check-in [d27cddf1]
Login

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

Overview
Comment:blob_to_utf8_no_bom(): the starts_with_utf16(le|be)_bom calls were swapped.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d27cddf17cc25c5248091de5292e63f457ab92b8
User & Date: jan.nijtmans 2012-11-27 09:42:17
Context
2012-11-27
13:15
Make the --admin-user for the "init" command also be the login user. Ticket [1038e224fa3956] check-in: 4eb637fd user: drh tags: trunk
12:10
merge trunk check-in: 2e1f2e69 user: jan.nijtmans tags: improve_commit_warning
11:26
merge trunk check-in: 71cd228b user: jan.nijtmans tags: ticket-d17d6e5b17
11:10
Suggested fix for [1038e224fa] Closed-Leaf check-in: 9f3622b2 user: jan.nijtmans tags: ticket-1038e224fa
09:46
merge trunk check-in: 35f5c40c user: jan.nijtmans tags: convert_before_commit_v2
09:42
blob_to_utf8_no_bom(): the starts_with_utf16(le|be)_bom calls were swapped. check-in: d27cddf1 user: jan.nijtmans tags: trunk
00:23
Assume that the NetSurf browser is operated by a human. check-in: 77cd6e0d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/blob.c.

1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
    struct Blob temp;
    zUtf8 = blob_str(pBlob) + bomSize;
    blob_zero(&temp);
    blob_append(&temp, zUtf8, -1);
    blob_swap(pBlob, &temp);
    blob_reset(&temp);
#ifdef _WIN32
  }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){
    /* Make sure the blob contains two terminating 0-bytes */
    blob_append(pBlob, "", 1);
    zUtf8 = blob_str(pBlob) + bomSize;
    zUtf8 = fossil_unicode_to_utf8(zUtf8);
    blob_zero(pBlob);
    blob_append(pBlob, zUtf8, -1);
    fossil_mbcs_free(zUtf8);
  }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){
    unsigned int i = blob_size(pBlob);
    zUtf8 = blob_buffer(pBlob);
    while( i > 0 ){
      /* swap bytes of unicode representation */
      char zTemp = zUtf8[--i];
      zUtf8[i] = zUtf8[i-1];
      zUtf8[--i] = zTemp;







|







|







1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
    struct Blob temp;
    zUtf8 = blob_str(pBlob) + bomSize;
    blob_zero(&temp);
    blob_append(&temp, zUtf8, -1);
    blob_swap(pBlob, &temp);
    blob_reset(&temp);
#ifdef _WIN32
  }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){
    /* Make sure the blob contains two terminating 0-bytes */
    blob_append(pBlob, "", 1);
    zUtf8 = blob_str(pBlob) + bomSize;
    zUtf8 = fossil_unicode_to_utf8(zUtf8);
    blob_zero(pBlob);
    blob_append(pBlob, zUtf8, -1);
    fossil_mbcs_free(zUtf8);
  }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){
    unsigned int i = blob_size(pBlob);
    zUtf8 = blob_buffer(pBlob);
    while( i > 0 ){
      /* swap bytes of unicode representation */
      char zTemp = zUtf8[--i];
      zUtf8[i] = zUtf8[i-1];
      zUtf8[--i] = zTemp;