dqjmq28248 2012-08-07 09:54
浏览 238
已采纳

PHP,将UTF-8转换为ASCII 8位

I'm trying to convert a string from UTF-8 to ASCII 8-bit by using the iconv function. The string is meant to be imported into an accounting software (some basic instructions parsed accordingly to SIE standards).

What I'm running now:

iconv("UTF-8", "ASCII", $this->_output)

This works for accounting software #1, but software #2 complains about the encoding. Specified encoding by the standard is: IBM PC 8-bit extended ASCII (Codepage 437).

My question is, what version of ASCII is PHP encoding my string into, and if other than specified - how can I encode the string accordingly to the standard specification?

  • 写回答

1条回答 默认 最新

  • dongmi4734 2012-08-07 09:59
    关注

    try this for the software #2

    iconv("UTF-8", "CP437", $this->_output);
    

    Extended ASCII is not the same as plain ASCII. The first one maybe accepts ASCII, but the second software requires Extended ASCII - Codepage 437

    see this link

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样