Results 1 to 2 of 2

Thread: RC6: Best practice for detecting text encoding

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2017
    Posts
    760

    Question RC6: Best practice for detecting text encoding

    Hello!

    I have learnt so much about detecting text encoding that I know that it has to be guessed.
    I am using RC6, and I wonder what the best practice is to either detect the decoding. I have not found such a method, but perhaps I overlooked it.
    Or if it doesn't exist, then it would be great to hear how others do it.
    Currently I use new_c.fso.ReadTextContent and have a look at the characters to detect the encoding.
    But I wonder if I should call .ReadByteContent instead, and since it doesn't have a range option, I wonder what RC6 sees as the best way to handle this topic.

    Thank you!

  2. #2
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,891

    Re: RC6: Best practice for detecting text encoding

    When you use cFSO.ReadTextContent, it will autodetect the encoding if the file starts with a known BOM (Unicode BE, Unicode LE, or UTF-8). For files without a BOM, I think you would have to come up with your own heuristic (or use someone else's) to make an educated guess at the encoding

Tags for this Thread

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