前一段时间写PHP,经常在解析文件之前就要对数据进行处理判断,并以header()的方式进行页面跳转.然而后来将文件放到 linux 服务器时常碰到header()解析出错的情况,而在 windows 开发环境中本地调试无任何问题.后来发现是文件编码格式的原因,转换成以UTF-8无BOM编码格式的文件就不会报错了. 附上BOM的解释:https://en.wikipedia.org/wiki/Byte_order_mark 以及知乎上的讨论:「带 BOM 的 UTF-8」和「无 BOM 的 UT
In order to omit the byte order mark (BOM), your stream must use a custom instance of UTF8Encoding instead of the default System.Text.Encoding.UTF8: 1.Call the UTF8Encoding constructor with False for the encoderShouldEmitUTF8Identifier parameter. 2.P
select msi.segment1, msi.description, . msi.item_type, msi.inventory_item_status_code 状态 from inv.mtl_system_items_b msi where msi.organization_id = X and msi.item_type in ('FG','SA') and msi.inventory_item_status_code <>
一般用在比较费时的循环中,往往导致应用程序没有响应,此时在比较费时的程序体中加入Application.ProcessMessages即可解决,该语句的作用是检查并先处理消息队列中的其他消息. 例如,在如下的程序中,加入该语句,则在程序运行过程中可以随便拖动窗口. procedure TForm1.Button1Click(Sender: TObject); var i: Integer; begin for i := 0 to 500000 do begin Canvas.TextOut(10