XAMPP:全局设置编码类型 [英] XAMPP: setting the encoding type globally

查看:123
本文介绍了XAMPP:全局设置编码类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Windows计算机上运行csv解析器并将输出重定向到文件中时,在OpenOffice Calc中打开文件时,总会出现换行符加倍的情况。此外,如果我在notepad ++中复制文件的内容,然后使用默认的ANSI编码将其保存为新文件,则文件的大小将减小一半,并且在Calc中可以正确显示换行符。

When I run a csv parser on my windows machine, and redirect the output into a file, I always get doubled up line breaks when I open the file in OpenOffice Calc. Further, if I copy the contents of the file in notepad++, then save that as a new file using the default ANSI encoding, the file is half as big and line breaks display properly in Calc.

我不想在我处理的每个文件中添加设置或标头,因为这些脚本在Linux上的PHP安装中工作正常。

I'd prefer not to have to add a setting or header to every file I work on, since these scripts work fine on a linux install of PHP.

我认为更改php.ini中的设置将解决此问题,但是我不知道它是什么,而且我没有太多运气找到它。有人知道如何解决此问题吗?

I assume that changing a setting in php.ini will fix this, but I don't know what it is and I haven't had much luck finding it. Does anyone know how to resolve this issue?

推荐答案

一个INI指令,以更改默认情况下在 Content-Type 标头:

There is an INI directive to change the character set sent by default in the Content-Type header:

每个示例:

default_charset = "iso-8859-1"

这篇关于XAMPP:全局设置编码类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆