Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7ef1356ba906d7a4a91662eb360c855448d5f5af
Ticket: 219341ffffffffffffffffffffffffffffffffff
Unicode line separator \u2028 not recognized
User & Date: andreas_kupries on 2001-04-10 13:55:51
Changes

  1. assignee changed to: "andreas_kupries"
  2. icomment:
    Logged In: YES 
    user_id=75003
    
    Doug Edmunds is <[email protected]>.
    
    Here his answer to my questions ___________________________
    
    Look at the attached utftest.tcl file. The "appropriate
    conversion" is the line:
    
        fconfigure $fileid -encoding unicode
    
    needed to correctly read-in a utf-16 file. A utf-8 file
    doesn't need any conversion
    
    Since you asked about this, I have reconstructed the issue, 
    using a Windows-based unicode editor (freeware) called SC
    Unipad. It is available at  http://www.sharmahd.com/unipad/
    
    With that program (which uses the unicode line-separator
    instead of CR, LF, LFCR) files can be saved in a multitude
    of unicode formats, include utf-8 and both utf-16 big endian
    and utf-16 little endian.
    
    Attached are 2 files, generated with that editor,
    appropriately named utf8test.txt and utf16text.txt.
    
    Also enclosed is a short tcl file which is supposed to open
    these files and print some info out to a tcl console. I used
    the console that opens with wish83.exe.
    
    Here's the issue: Instead of producing
    
    Total contents of the utf-8 file are:
    this is a file with
    multiple lines, which
    will be saved as
    utf-8
    
    It produces
    Total contents of the utf-8 file are:
    this is a file with�multiple lines, which�will be
    saved asâ?¨utf-8
    
    Similarly, using the 'appropriate conversion' the
    line-separator is lost, for the utf-16 file:
    
    this is a file with
    multiple lines, which
    will be saved as
    utf-16 (little endian)
    
    It looks like this:
    this is a file withmultiple lines, whichwill be saved
    asutf-16 (little
    endian)
    
    (but which copy-paste converts into question-marks, showing
    that the characters are really retained by tcl, but just are
    not being printed correctly):
    
    What copy-from-tcl-console paste-to-email produces:
    ?this is a file with?multiple lines, which?will be saved
    as?utf-16 (little
    endian)?
    
    I hope this helps.  Personally, I think there will always be
    problems until the underlying OS is based on unicode.
    
    
    
  3. login: "andreas_kupries"
  4. mimetype: "text/plain"
  5. username: "andreas_kupries"