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 8548497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:30:37+00:00 2026-06-11T13:30:37+00:00

The built-in routine HttpQueryInfo returns a string, not actual bytes. Normally that is not

  • 0

The built-in routine HttpQueryInfo returns a string, not actual bytes. Normally that is not a problem.

However, lately I have begin to encounter a problem with servers issuing redirects where the location header field contains an URL which includes non-percentage-encoded unicode/or? characters. Any way around this?

        var
          vContent_Wide: WideString;
        begin 
          vBufferSize := 4096;
          GetMem(vBufferPtr, vBufferSize);
          while True do
          begin
            TmpFakeCardinal := 0;
            vErrorNone := HttpQueryInfo(
              hHttpOpen_Request,
              HTTP_QUERY_RAW_HEADERS_CRLF,
              vBufferPtr,
              vBufferSize,
              TmpFakeCardinal
            );
            if (vErrorNone = False) then
              begin
                vErrorID := GetLastError;
                if (vErrorID = ERROR_INSUFFICIENT_BUFFER) then
                  begin
                    FreeMem(vBufferPtr);
                    GetMem(vBufferPtr, vBufferSize);
                  end
                else Break;
              end
            else
              begin
                vContent_Wide := PWideChar(vBufferPtr); 
                Result := vContent_Wide;
                Break;
              end
            ;
          end;
          FreeMem(vBufferPtr, vBufferSize);
  • 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-06-11T13:30:39+00:00Added an answer on June 11, 2026 at 1:30 pm

    URIs do not support unencoded Unicode characters. If the server is sending a non-percent-encoded Unicode string in the Location header then the server is buggy and needs to be fixed as this is a clear violation of RFC 2616 section 14.30. My guess is that the server is actually sending an unmapped IRI (RFC 3987) instead of a URI (RFC 3986). HTTP does not support direct use of IRIs, they have to be mapped to URIs (RFC 3987 defines how to do that).

    With that said, check if setting the dwInfoLevel parameter to HTTP_QUERY_CUSTOM allows HttpQueryInfo() to return the raw bytes of the header or not. If not, then you will not be able to use WinInet for those servers that are failing, as there are no other functions in the WinInet API that can access HTTP headers. You will have to find another HTTP library that supports what you need, or else you can drop down to the TCP/IP layer and implement the HTTP protocol manually in your own code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem: I built an application in c# .net 2.0 that is
I built a linear layout inside of a dialog , the problem here that
I have a legacy VB6 application that was built using MSDE. As many client's
Is there any in-built stable sort routine in .NET? I know that C++ has
Ive built a little jquery sliding div on my website that when you hover
We have a large WinForms app, and there is a built-in bug reporting system
I have a Hudson job that just does a check-out/update to a third-party library.
I have a DB that contains a list of paths to files. I want
Can anyone suggest a Delphi library that will covert a date string in the
Writing a routine WinForms app that references a few custom libraries written by myself.

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.