Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6019579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:26:32+00:00 2026-05-23T03:26:32+00:00

I’m using HttpGetText with Synapse for Delphi 7 Professional to get the source of

  • 0

I’m using HttpGetText with Synapse for Delphi 7 Professional to get the source of a web page – but feel free to recommend any component and code.

The goal is to save some time by ‘unifying’ non-ASCII characters to a single charset, so I can process it with the same Delphi code.

So I’m looking for something similar to “Select All and Convert To UTF without BOM in Notepad++”, if you know what I mean. ANSI instead of UTF8 would also be okay.

Webpages are encoded in 3 charsets: UTF8, “ISO-8859-1=Win 1252=ANSI” and straight up the alley HTML4 without charset spec, ie. htmlencoded Å type characters in the content.

If I need to code a PHP page that does the conversion, that’s fine too. Whatever is the least code / time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:26:33+00:00Added an answer on May 23, 2026 at 3:26 am

    I instead did the reverse conversion directly after retrieving the HTML using GpTextStream. Making the documents conform to ISO-8859-1 made them processable using straight up Delphi, which saved quite a bit of code changes. On output all the data was converted to UTF-8 🙂

    Here’s some code. Perhaps not the prettiest solution but it certainly got the job done in less time. Note that this is for the reverse conversion.

    procedure UTF8FileTo88591(fileName: string);
    const bufsize=1024*1024;
    var
    fs1,fs2: TFileStream;
    ts1,ts2: TGpTextStream;
    buf:PChar;
    siz:integer;
        procedure LG2(ss:string);
        begin
            //dont log for now.
        end;
    
    begin
        fs1 := TFileStream.Create(fileName,fmOpenRead);
        fs2 := TFileStream.Create(fileName+'_ISO88591.txt',fmCreate);
        //compatible enough for my purposes with default 'Windows/Notepad' CP 1252 ANSI and Swe ANSI codepage, Latin1 etc.
        //also works for ASCII sources with htmlencoded accent chars, naturally
        try
          LG2('Files opened OK.');
          GetMem(buf,bufsize);
          ts1 := TGpTextStream.Create(fs1,tsaccRead,[],CP_UTF8);
          ts2 := TGpTextStream.Create(fs2,tsaccWrite,[],ISO_8859_1);
          try
            siz:=ts1.Read(buf^,bufsize);
            LG2(inttostr(siz)+' bytes read.');
            if siz>0 then ts2.Write(buf^,siz);
          finally
            LG2('Bytes read and written OK.');
          FreeAndNil(ts1);FreeAndNil(ts2);end;
        finally FreeAndNil(fs1);FreeAndNil(fs2);FreeMem(buf);
            LG2('Everything freed OK.');
        end;
    end; // UTF8FileTo88591
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
In order to apply a triggered animation to all ToolTip s in my app,
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.