使用 idHTTP 获取 UTF-8 编码的中文网页

uses IdHTTP;

const Url = 'http://del.cnblogs.com';

procedure TForm1.Button1Click(Sender: TObject);
var
  stream: TStringStream;
  idHttpObj: TIdHTTP;
begin
  stream := TStringStream.Create('', TEncoding.UTF8); //

  idHttpObj := TIdHTTP.Create(nil);
  idHttpObj.Get(Url, stream);
  idHttpObj.Free;

  Memo1.Text := stream.DataString;
  stream.Free;
end;

https://www.cnblogs.com/del/archive/2011/12/30/2307965.html

转载于:https://www.cnblogs.com/railgunman/p/10290716.html

IdHTTPServer+utf8转换+json解析 本demo用IdHTTPServer接收上报数据,然后进行utf8编码转换,在用delphixe10.2自带的json作解析,代码简洁实用. 立即下载

相关推荐

Delphi XE + IdHTTPServer + utf8转换 + json解析(源码+测试可用)

Delphi XE + IdHTTPServer + utf8转换 + json解析(源码+测试可用)

【亲测免费】 Delphi XE开发者的福音:IdHTTPServer与JSON解析一站式解决方案

Delphi XE开发者的福音:IdHTTPServer与JSON解析一站式解决方案 【下载地址】DelphiXEIdHTTPServerUTF-8转换JSON解析源码测试可用 本项目是专为Delphi XE开发者设计的一个实用资源,旨在展示如何在Delphi XE环境中集成Indy库中的IdHTTPServer组件,实...

gitblog_09782的博客 795

攻克JESD204B多ADC同步:从时钟对齐到数据对齐的实战解析

本文深入解析了JESD204B多ADC同步的系统性挑战与实战解决方案。从确保设备时钟同源、精确捕获SYSREF信号,到管理接收端弹性缓冲区与释放点,文章提供了从时钟对齐到数据对齐的完整调试路径与排查清单,是攻克高速数据采集系统中多片ADC同步难题的实用指南。

weixin_29231725的博客 199

UTF-8 response of TIdHTTPServer with Free Pascal

原链接:原链接 问题 (Question) This code starts a HTTP server which listens for requests on port 8080. When compiled with Delphi 2009, the Chinese text is rendered correctly. With Free Pascal 2.6.0

xushuyi07的专栏 1327

使用kali对局域网内的主机进行远程控制

输入命令:hydra -l administrator -P/usr/share/woerdlists/rockyou.txt 192.168.100.241 smb -V。账户(adminitrator)密码:123456 【一般账户都是我们知晓了,如果不知道账户进行破解那几乎不太可能,密码如果设置的特别复杂无规律也是特别难破解的】【-r:扫描整个网段 后面就是设置 192.168.241.100/24的网络地址段 为 192.168.241.0/24 0和/24之间不要空格】

2301_77599769的博客 2281

Python爬虫教程:爬取法院司法拍卖数据全流程实战(附反爬+数据分析方案)

Python爬虫爬取法院司法拍卖数据的核心是模拟真人行为规避反爬+精准解析页面数据+合理处理数据。新手不用一开始就追求高级的反爬技巧和复杂的数据分析,先把基础的分页爬取和数据保存功能跑通,再逐步优化。我做的这个工具现在每周帮朋友爬取全国10个城市的法拍房数据,自动生成分析报告,他说这让他的投资决策效率提升了一倍。如果你们在开发过程中遇到问题,比如反爬失败、数据解析错误,都可以在评论区留言,我会尽力解答。后续我还会出一期爬取京东司法拍卖数据的教程,帮助大家获取更多的法拍数据来源。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 2187

idhttp返回乱码_idhttp utf-8乱码问题解决

先看一个例子procedure TForm1.Button1Click(Sender:TObject);varResponse2:TStringStream;S : string;//注意必须是string,网上说的widestring 执行空白beginIdHTTP1.HandleRedirects:=true;Response2 :=TStringStream.Create('');idht...

weixin_39609354的博客 670

实测!Gemini+ChatGPT赋能学术写作:我的论文写作SOP(附提示词)

各位同仁好,我是七哥。一个在高校里从事人工智能相关领域研究,钻研用大模型AI实操的学术人。可以和七哥交流学术写作或Gemini、GPT、Claude等大模型学术实操相关问题,多多交流,相互成就,共同进步。为什么ChatGPT逻辑清晰却写不长?为什么Gemini能深入分析但废话连篇?这其实是两种模型架构的本质差异,GPT系列擅长指令跟随和语言精炼,而Gemini原生支持超长上下文,适合深度文本生成。两者在深度生成与精炼表达上形成了天然互补。我们可以将它们组合起来使用发挥他们各自的特长。

智能AI让学术科研更容易 526

使用 idHTTP 获取 UTF-8 编码的中文网页 - 回复同学 "Delphi学习者" 的问题

uses IdHTTP; const Url = 'http://del.cnblogs.com'; procedure TForm1.Button1Click(Sender: TObject); var stream: TStringStream; idHttpObj: TIdHTTP; begin stream := TStringStream.Creat...

weixin_30326741的博客 176

uniapp(全端兼容) - 最新详细uniapp全平台植入使用echarts图表插件,引入 Echarts 图表及使用详细教程,提供各种图表使用示例(拒绝复杂的过程,附带详细的使用示例保姆级教程)

uniapp 微信小程序 echats 图表,uni-app小程序引用echarts,niapp 微信小程序引入echats教程,uniapp 使用echats图表,uniapp开发如何在微信小程序平台使用echats图表,uniapp开发的小程序中怎么用echats,在uni-app中编译到微信小程序如何使用echarts,UNIAPP微信小程序使用Echarts,uni-app微信小程序使用echarts,Uniapp小程序端使用echarts最详细的教程,uni-app中使用Echarts绘画图表,u

✅ 精选推荐文章 1万+

【安卓逆向】python版本 sha源码

免责声明本文内容仅供学习交流使用,严禁用于商业和非法用途。抓包数据、敏感网址以及数据接口已进行脱敏处理。 注:如有引用,请标注文章地址!!!!!!!

Coodekun的博客 817

用IdHTTP获取UTF-8编码的网页

本程序和网上的说法不同,在D7下执行通过 先看一个例子 procedure TForm1.Button1Click(Sender: TObject); var Response2:    TStringStream; S : string;//注意必须是string ,网上说的widestring 执行空白 begin IdHTTP1.HandleRedirects:=true; R

chinajobs的专栏 2157

万字详解YOLOv8网络结构Backbone/neck/head以及Conv、Bottleneck、C2f、SPPF、Detect等模块

YOLOv8是由Ultralytics开发的最先进的目标检测模型,推升了速度、准确性和用户友好性的界限。YOLO这一缩写代表“你只看一次”(You Only Look Once),通过在一次网络传递中同时预测所有边界框,提升了算法的效率和实时处理能力。相比之下,其他一些目标检测技术需要经过多个阶段或过程来完成检测。YOLOv8在流行的YOLOv5架构上进行了扩展,在多个方面提供了改进。

专注于图像领域,主要研究内容包括计算机视觉和深度学习,特别是在图像分类、目标检测和图像生成等方面有深入的研究和实践经验。 14万+

idhttp webbrowser

<br />都是与网页相关的控件<br /> <br /> <br />idhttp可以直接操作底层数据<br /> <br /> <br />webbrowser则是封装了对模拟浏览器 的操作<br /> <br /> <br /> <br /> <br /> <br />1、idhttp 获取中文网页内容乱码<br /> <br />procedure TForm1.Button1Click(Sender: TObject); var f : textFile; ss : TStr

马东成 1112

太空安全卫士:基于YOLOv5的空间态势感知系统(实现轨道碰撞预警与太空环境保护)

做完这个项目,你会发现自己完整走过了“数据采集→标注→模型训练→功能集成→界面开发”的毕设全流程,这不仅是技术能力的证明,更是对“技术守护宇宙安全”这一理念的实践。答辩时,你可以重点讲这几点:系统解决了航天监测的哪些痛点、YOLOv5在太空目标检测中的性能优势、系统未来能怎么优化(比如对接航天监测网络、实现实时轨道预测)。未来,这个系统还能往“更智能”的方向发展:比如结合轨道计算预测碰撞风险、开发移动端APP让天文爱好者参与太空垃圾上报、在航天任务中实现全自动避障决策……想象空间很大。

m0_71589036的博客 92

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Delphi idhttp解决获取UTF-8网页中文乱码问题

超简单~加个函数转换下就OK了~ UTF8Decode() 我的用法是Memo1.text:=UTF8Decode(idhttp1.get('')); 转自:http://hack518.blog.sohu.com/99364146.html

1290

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

IDHTTP中文乱码问题

对于跟我一样刚学Delphi的新手 有时候编写程序要获取某个网页代码 但老是遇到乱码的问题 想当初就为这个问题我花了好长时间反复测试 所以这里我帖一些自己的代码 希望能帮到大家... //================================================================================ delphi7里idhttp(UTF-8网页

nextop88的专栏 2868

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

delphi html 乱码,Delphi idhttp解决获取UTF-8网页中文乱码问题

标签:网页fork访问wwwbloghttpsnet需要nbsp超简单~加个函数转换下就OK了~UTF8Decode()我的用法是Memo1.text:=UTF8Decode(idhttp1.get(‘‘));转自:http://hack518.blog.sohu.com/99364146.htmlhttps://www.iteye.com/blog...

weixin_30074763的博客 850

ddd

![TTHX7%CWPQMTVV]7`M]VV.png](https://img-blog.csdnimg.cn/img_convert/85ce59a9d003066be579b32e79feddfc.png) delphi 使用 idHTTP 获取 UTF-8 编码的中文网页 procedure TForm2.Button1Click(Sender: TObject); var IdHttp1: TIdHTTP; Url,s,ResponseStr: string;//请求地址 ..

编程入门的博客 944

Delphi网络Web编程心得

 URL编码可以使用HttpApp.pas中的HTTPEncode对百度,直接使用HTTPEncode()编码就好了,但对Google,有点特别,需要做如下的编码HTTPEncode(UTF8Encode(url))即先做utf8编码再做url编码  IdHTTP的设置  IdHTTPWorker.AllowCookies := False; I

eulb的专栏 2001
上一篇: idHTTP 向网站发送json格式数据
下一篇: delphi TIdHTTP Post乱码问题
aowo7144
博客等级 码龄10年 5粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值