TIdTextEncoding.Default replacement

I just updated to the latest Indy and I can't compile code like this...

HTTP.Get(URL,i,TIdTextEncoding.Default);

I don't recall why I had to do this a few years ago but something was mangling the transfer of characters and this fixed it. What is the replacement method to do the same thing now without changing a global default?

Thanks.
-2
Ross
3/21/2014 4:09:47 AM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

2 Replies
4257 Views

Similar Articles

[PageSpeed] 1

After some investigation, does this have the same effect?

HTTP.Get(URL,i,IndyTextEncoding_OSDefault);
1
Ross
3/21/2014 1:07:12 PM
Ross wrote:

> I just updated to the latest Indy and I can't compile code like this...
> 
> HTTP.Get(URL,i,TIdTextEncoding.Default);

TIdTextEncoding was removed in Indy 10.6:

Indy 10.6 has been released
http://indyproject.org/sockets/blogs/changeLog/20130423.EN.aspx

{quote}
the IdGlobal.TIdTextEncoding class has been replaced with a new IdGlobal.IIdTextEncoding 
refcounted interface ...
{quote}

> I don't recall why I had to do this a few years ago but something
> was mangling the transfer of characters and this fixed it.

You are specifying an encoding in the ADestEncoding parameter of TIdHTTP.Get(). 
 That parameter is only available in pre-Unicode versions of Delphi.  When 
TIdHTTP.Get() returns data as a String, it decodes the downloaded data to 
Unicode using the charset specified in the HTTP response.  In Delphi 2009+, 
it returns that Unicode data as-is.  But earlier versions, it has to convert 
the Unicode data to AnsiString, so the ADestEncoding parameter specifies 
the Ansi encoding to use for that conversion.  If you do not specify an encoding, 
Indy's default encoding is used, and that is ASCII uness you configure the 
global IdGlobal.GIdDefaultTextEncoding variable to a different encoding (OSDefault, 
8bit, or UTF-7/8/16).

> What is the replacement method to do the same thing now without
> changing a global default?

The IndyTextEncoding_OSDefault() function.

--
Remy Lebeau (TeamB)
1
Remy
3/21/2014 9:36:03 PM
Reply:

Similar Artilces:

Replacing Default.aspx as default document
I'm using a different default file for folders. I need to use MyPage.aspx as a default so if someone loads /Folder it will load up MyPage.aspx instead of Default.aspx. I configured IIS to do this properly but changing the documents setting but I don't knwo where to change this on the local VS asp.net development server. When I go to /Folder i get a directory listing instead of executing MyPage.aspx.   Try setting the enable Directory Listing to false in IISVikram www.vikramlakhotia.comPlease mark the answer if it helped you It's not an IIS problem. IIS works perfectly. ...

superreview granted: [Bug 256663] old default plugin/new plugin placeholder can both appear on same page : [Attachment 157081] Never show the default plugin replacement if the default plugin is still
David Baron <dbaron@dbaron.org> has granted David Baron <dbaron@dbaron.org>'s request for superreview: Bug 256663: old default plugin/new plugin placeholder can both appear on same page http://bugzilla.mozilla.org/show_bug.cgi?id=256663 Attachment 157081: Never show the default plugin replacement if the default plugin is still enabled. http://bugzilla.mozilla.org/attachment.cgi?id=157081&action=edit ...

Delphi 2010: AV when switching from Default to debug layout and when closing Delphi
Hello, I experience strange AVs in rtl140.bpl when switching from the Default to the Debug Layout (e.g. when starting the application) or when closing Delphi 2010. I have a bunch of Addins (Modelmaker Code Explorer, EurekaLog, DDevExtensions, JCL, etc...), components installed. Any ideas/tools to possibly track down where the culprit is? Possibly simply an addin in combination with docked windows etc. Thanks, Thomas > {quote:title=Thomas Steinmaurer wrote:}{quote} > I experience strange AVs in rtl140.bpl when switching from the Default > to the Debug Layout (...

superreview denied: [Bug 294531] Design new interfaces for certificate path building and verification for libPKIX : [Attachment 309303] Replace set default function with get default function
Kai Engert (:kaie) <kengert@redhat.com> has denied Julien Pierre <julien.pierre.boogz@sun.com>'s request for superreview: Bug 294531: Design new interfaces for certificate path building and verification for libPKIX https://bugzilla.mozilla.org/show_bug.cgi?id=294531 Attachment 309303: Replace set default function with get default function https://bugzilla.mozilla.org/attachment.cgi?id=309303&action=edit ------- Additional Comments from Kai Engert (:kaie) <kengert@redhat.com> Julien, I think this is explicitly not what we would like to happen. Your chang...

superreview requested: [Bug 294531] Design new interfaces for certificate path building and verification for libPKIX : [Attachment 309303] Replace set default function with get default function
Julien Pierre <julien.pierre.boogz@sun.com> has asked for superreview: Bug 294531: Design new interfaces for certificate path building and verification for libPKIX https://bugzilla.mozilla.org/show_bug.cgi?id=294531 Attachment 309303: Replace set default function with get default function https://bugzilla.mozilla.org/attachment.cgi?id=309303&action=edit ------- Additional Comments from Julien Pierre <julien.pierre.boogz@sun.com> This change should help prevent application components from stepping on each other's toes. We still have CERT_SetUsePKIXForValidati...

superreview requested: [Bug 294531] Design new interfaces for certificate path building and verification for libPKIX : [Attachment 309303] Replace set default function with get default function #2
Julien Pierre <julien.pierre.boogz@sun.com> has asked Kai Engert (:kaie) <kengert@redhat.com> for superreview: Bug 294531: Design new interfaces for certificate path building and verification for libPKIX https://bugzilla.mozilla.org/show_bug.cgi?id=294531 Attachment 309303: Replace set default function with get default function https://bugzilla.mozilla.org/attachment.cgi?id=309303&action=edit ...

Issue with TIdTextEncoding.Default
Hi, Since Indy 10.5.5, I explicitely use TIdTextEncoding.Default as default string encoding for the sockets, in order to transfer ANSI-based messages between the peers. Nevertheless, some characters are still not transfered properly, while there was no problem with the 10.2.3 version. For instance, consider the string "ABC’DEF". Using TIdTextEncoding.Default, when the client sends this string, the server receives "ABC?DEF". AFAIK, the character "’" is a legal ANSI character which should be handled by TIdTextEncoding.Default. If I modify IdGl...

Replace default nsHelperAppDlg
Hello! For a kiosk application I need to suppress all instances of nsHelperAppDlg and nsFilePicker. I have managed to do this by stripping all code from the functions in the JS files, leaving just the interface definitions and default return values. But this seems quite hackish and unstable to me. Is there any way to write a regular extension that returns a "dummy" object when an Instance of "@mozilla.org/helperapplauncherdialog;1" is created? Gabriel On 14 Oct 2006 07:45:42 -0700, gabriel.birke@gmail.com <gabriel.birke@gmail.com> wrote: > Hello! ...

Replacing default __iterator__?
Hi, I'm trying to replace the __iterator__ of an object with a custom iterator, then iterate over the object in a for..in loop. It seems that the loop only iterates over the intersection of two sets: 1) the set of properties that would be returned by the default iterator 2) the set of properties returned by the custom iterator Here's the code I'm testing: > var obj = {a:1, __iterator__: function() { return (function() { yield "a"; yield 2 })() } } > for(var i in obj) print(i + "->" + obj[i]) a->1 > obj[2] = 4 4 > for(var i in ob...

replacing default value
hiii there..!!!           i have a textbox named cevent and a field  named memid in database. if i don enter  anything in cevent txtbox then   memid field in database takes the default value but if i enter smthin in cevent textbox then in memid field the value shuld b replaced by the txtbox value.                   mya i knw hw  do i fix this..??? thanx. Hi, If you want to fix an old problem, kindly post the code. If it is a new req...

Default Default Assignee
Is it possible to create a default default assignee, when creating new components? How? In article <1122224112.695781.247600@g44g2000cwa.googlegroups.com>, listrecv@gmail.com wrote: > Is it possible to create a default default assignee, when creating new > components? How? No, at least not automatically. You must specify a default assignee every time you create a new component. The easiest thing do to may be to edit the "add a new area" template, either modifying the HTML to say "when in doubt, set the default assignee to *****", ...

Delphi default data controls
Hi everybody! Found nowhere in the internet and in the menu (options etc) how to change the default data controls at Delphi. I mean that if you drop a Table in DataModule and add fields to it and then drag-drop the fields into a form, delphi automatically produces the components on the form e.g. a tlabel and a tdbedit control for string fields. From where I can change this behavior in order to select other components (e.g. Devexpress)? Thanks a lot. PS: Delphi version XE2 NIKOLAOS VRACHIOLIS wrote: > Hi everybody! Found nowhere in the internet and in the menu (options etc) how...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

QuotedStr replacing Double Quote In Delphi
-1 down vote favorite I need to make a comma separated string which would have multiple string values and each of these value should be in single quote. When I am using QuotedStr, it is quoting with double-quote,instead of single. I even tried using single-quote but still it is having same issue. I tried googling but didn't get any resulting info. I tried AnsiQuotedStr, but no use. procedure TForm1.Button3Click(Sender: TObject); var TextValue1, TextValue2, TextValue3, TextValue4, CompleteTextValue : String; begin dsetMyQuert.Close; TextValue1 := '{...

How can I remove the delphi default icon?
Hello, is it possible (how) to remove the delphi default icon for my application to use the windows default exe icon depending on the OS version? I use Delphi 2007 and Delphi XE3. regards Mathias You mean : Menu-Project-Options-Application (tree node) ? Am 04.06.2014 15:13, schrieb Robert Triest: > You mean : Menu-Project-Options-Application (tree node) ? > Yes. ...

How to replace the default skin object controls?
Such as login user control? Without touching the core of course. Russel Skin Objects are part of the core and any change to them would involve changing things in there, however you can always add new objects. Or is there a particular reason for wanting to change the existing one? Salar KnapHill, Surrey UKSkinning & Building DotNetNuke Applications www.salaro.com Simply because I want to make a custom "signin" user control to replace the default \admin\security\signin.ascx control. It seems this part of DNN is pretty much hard wired, other than that I can modify...

Extending GridView ( replacing the default behaviour )
Hi, I have trouble extending the GridView class to suit my rather specific needs. My main trouble (besides multiple smaller ones) is that I want to be able to collapse multiple rows inside the table. Short background:I have a GridView that has the added functionality of grouping data per column ( Basically sorting the data and adding a header/footer around groups with the same value in that column ), it looks like this: It works fine and I can collapse entire groups of data, but the problem is that all this is done after the GridView has retrieved its data from the DataSource. All the ...

Default web-apps, replacing, settings
Hello all - Just thinking about web apps and replacing built-in/default apps. Thinking about replacing the contacts app (for example). This means that the user can somehow remove the default contacts app from the home screen (how? dwell on it with a touch and a pop-up appears with the option to remove it?) when they install a new contacts app. Then the user goes and removes the new contacts app. How do they get the original back? One thought is that the webapp manifest contains a list of capabilities the app provides. Then when an app is removed, if it is the last p...

Delphi XE TBytes default parameters.
Bought Delphi XE. Tried to compile my programs: Error: Parameters of this type cannot have default values: Turns out that TBytes no longer can have default parameter! --- Research gives the following... Declare TArray1 = array of Byte; TArray2 = TArray<Byte>; then procedure ByFunc1(AArray: TArray1 = nil) works fine, but procedure ByFunc1(AArray: TArray2 = nil) gives compiler error: Parameters of this type cannot have default values: -- That TBytes cannot have default parameters is really a breaking change. I have known that generics have n...

Replace the default page when Timeout has occurred
Hi 1- How i can replace the default page when Timeout has occurred 2- How i can replace the default page when an error ! i try to used IWURLResponder but it's not work! Thank You Maher -MSOFT > 1- How i can replace the default page when Timeout has occurred > 2- How i can replace the default page when an error ! check the custom error templates demo (IW XI demos http://www.atozed.com/intraweb/Download/IntraWebDemos.EN.aspx) > i try to used IWURLResponder but it's not work! check the timeout response demo ...

OpenOffice Calc find Replace in Delphi
XReplaceable I am using Delphi Vcl and I want to use Search&Replace command in openoffice or libreoffice calc program. there is one example in here ( http://stackoverflow.com/questions/7806041/how-to-search-and-replace-in-odt-open-office-document ) but it is work in only odt(word) file. I need for ods (calc) Find&Replace code for delphi ...

delphi.internet.winsock: text and base64
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_18c8b.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" See message in delphi.internet.winsock group. --JivePart=_18c8b.zeB8CwDOH5aMJzMl Content-Type: image/jpeg; name="buffer1.JPG" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="buffer1.JPG" /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zN...

Testing for a null and replacing with a default value
Hi All,Just a quick question about database nulls. I have a text box in a form view that I use to update a database record. The database does not allow nulls for that column.Rather than throw an error or use a validation control that forces data entry, I would simply like to check if nothing has been entered, and if that's the case replace it with default text like 'No data present'.I'm using VB and MS SQLThanks in advance for your help. Without allowing nulls, you can use the CASE statement in SQL select queries.  Select CASE WHEN myField = '' THEN...

Replacing the Timeout and Exception default pages?
Is it possible to replace the default Timeout and Unhandled Exception pages? How? Andre > Is it possible to replace the default Timeout and Unhandled Exception pages? > How? http://www.atozed.com/intraweb/docs/Develop/Layout/HTMLTemplates.aspx -- Jackson Gomes IntraWeb Support http://www.atozed.com/intraweb Blog: http://www.atozed.com/intraweb/blog Download: http://www.atozed.com/intraweb/download I cannot get it to work in IW 10. There is no documentation on how to sepcify various directories for IWServerController, for example: FilesDir, InternalFilesDir, Interna...