1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

@UTF8ENCODE?

Discussion in 'Support' started by vefatica, Aug 28, 2012.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    Is Unicode to UTF8 supposed to work? I posted this in another thread.

    Dan, your batch file piped to LIST worked OK for me using a 21K Unicode (BuildLog) HTM file. I know nothing of UTF8 so I tried this:

    Code:
    v:\> Set FileName=P:\synergy-1.3.1\gen\debug\buildlog.htm
    
    v:\> echo %@filesize[%filename]
    21262
    
    v:\> echo %@utf8encode[%filename, utf8.htm]
    0
    
    v:\> dir /k /m utf8.htm
    2012-08-28  20:17             134  utf8.htm
    
    v:\> type utf8.htm
    ├┐├╛<
    
    v:\>
    Since the output file was only 134 bytes, I doubt it was a correct conversion of the original. And using TYPE on it resulted in only a handful of characters being printed. So I'll start a thread about @UTF8ENCODE[].
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    Also from another thread. @UTF8ENCODE[] seems to turn 0x0D0A into 0X0D0D0A00. As I said I know nothing of UTF8 but it would seem unlikely it's supposed to look like that.
    Code:
    v:\> echo %@utf8encode[leontiev.txt,leontiev.utf8]
    0
     
    v:\> type /x leontiev.txt
    0000 0000 4c 65 6f 6e 74 69 65 66  20 77 6f 6e 20 74 68 65  Leontief won the
    0000 0010 20 4e 6f 62 65 6c 20 43  6f 6d 6d 69 74 74 65 65  Nobel Committee
    0000 0020 27 73 20 4e 6f 62 65 6c  20 4d 65 6d 6f 72 69 61  's Nobel Memoria
    0000 0030 6c 20 50 72 69 7a 65 20  69 6e 20 45 63 6f 6e 6f  l Prize in Econo
    0000 0040 6d 69 63 0d 0a 53 63 69  65 6e 63 65 73 20 69 6e  mic..Sciences in
    [snip]
    v:\> type /x leontiev.utf8
    0000 0000 4c 65 6f 6e 74 69 65 66  20 77 6f 6e 20 74 68 65  Leontief won the
    0000 0010 20 4e 6f 62 65 6c 20 43  6f 6d 6d 69 74 74 65 65  Nobel Committee
    0000 0020 27 73 20 4e 6f 62 65 6c  20 4d 65 6d 6f 72 69 61  's Nobel Memoria
    0000 0030 6c 20 50 72 69 7a 65 20  69 6e 20 45 63 6f 6e 6f  l Prize in Econo
    0000 0040 6d 69 63 0d 0d 0a 00 53  63 69 65 6e 63 65 73 20  mic....Sciences
    [snip]
     
    v:\>
     

Share This Page