Results 1 to 7 of 7

Thread: UNI code files

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833

    UNI code files

    how do I open a unicode "text" file
    this cannot be correct
    ---------------------------------------

    open "c:\temp" for binary as #1
    B() = input(lof(1),1)
    close #1

    MyString = replace(str(b()),chr(0),"")
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  2. #2
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    try...
    Code:
    Dim FileNum as integer
    Dim strMyString as string
    FileNum=FreeFile()
    Open "C:\myfile.txt" for Input as FileNum
      strMyString=Input(Lof(FileNum),FileNum)
    Close FileNum
      msgbox strMyString
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    this does not work

    I get

    past end of file or something

    I am currently doing it like I showed in my post

    there must be a simple way to open a uni-code file and convert it into a string.
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  4. #4
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    Your code doesn't work for me, but the code I provided worked fine. Input past End of File?
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    are you opening a unicode file?

    here is one of the files

    try opening it in wordpad
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Anybody give it a try?

    my first example didn't work because I didn't declare b() as a byte

    dim b() as byte
    open "c:\temp" for binary as #1
    b() = input(lof(1),1)
    close #1
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  7. #7
    Dreamlax
    Guest
    MSDN has some stuff about reading DBCS. Here is a some unicode...:

    &#65&#66&#67&#12363&#12365&#12367&#12369&#12371

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width