Fossil

Check-in [1c5b51e6]
Login

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

Overview
Comment:Handle utf16 text pages in the /doc webpage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1c5b51e6bf1706f2778c6a4e6f6f19d671b32359
User & Date: drh 2014-01-14 13:39:26
Context
2014-01-14
13:41
Make a change to the test/utf16le.txt file as a test case to verify that the diff logic displays utf16 changes correctly. check-in: 6228efbb user: drh tags: trunk
13:39
Handle utf16 text pages in the /doc webpage. check-in: 1c5b51e6 user: drh tags: trunk
12:44
Add the ability to display content and diffs for UTF16 text files in the web interface. check-in: 5a66b6e7 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/doc.c.

481
482
483
484
485
486
487

488
489
490
491
492
493
494

    /* Get the file content */
    if( content_get(rid, &filebody)==0 ){
      goto doc_not_found;
    }
    db_end_transaction(0);
  }


  /* The file is now contained in the filebody blob.  Deliver the
  ** file to the user 
  */
  zMime = P("mimetype");
  if( zMime==0 ){
    zMime = mimetype_from_name(zName);







>







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495

    /* Get the file content */
    if( content_get(rid, &filebody)==0 ){
      goto doc_not_found;
    }
    db_end_transaction(0);
  }
  blob_to_utf8_no_bom(&filebody, 0);

  /* The file is now contained in the filebody blob.  Deliver the
  ** file to the user 
  */
  zMime = P("mimetype");
  if( zMime==0 ){
    zMime = mimetype_from_name(zName);

Added test/utf16le.txt.













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
This file contains utf-16le text.
The purpose for including this file in the Fossil
repository is to provide the ability to test Fossil's
handling of UTF-16 using its own repository.

Browsing to this file should display the file as text on the screen.

When there are changes to this file those changes should show
up in the "diff" output and be properly displayed on the
screen.

Test procedures:

  1.  Verify that this file is correctly display using the /artifact
      webpage.
 
  2.  Verify that this file is correctly displayed by the /doc webpage.

  3.  Verify that changes to are correctly displayed by the /fdiff webpage.

  4.  Verify that the "fossil diff" command correctly displays changes
      in this file.  Do the same with the --tk option.