Environment Detail:

  • BitNami WAMP Stack 5.4.26-0
  • Windows 7 Professional
  • Encoding: UTF-8 without BOM

I am deployed my project on production server (windows 7). However I found out that something really weird happen to my file. I try to output the variable. I keep on debugging until I found this weird output.

The WORKING file look like got weird character between the period. The one without weird character between period is not working..

From WinMerge:

From Command Prompt cat Command output:

This is the source file http://pastebin.com/8C1qj1tn

You cannot see any diff from the browser or paste to the notepad / notepad++, you try to open with WinMerge or cat in command prompt then you can see the line 9 and 20 have the diff. The weird thing is line 20 one work in my production server, but not the line 9..

有帮助吗?

解决方案

It basically is encoding issue. I use notepad++ click on the Encoding -> Convert to ANSI, then I found out the is a question mark beside the period. (it works like this .?), and also the config file, inside the single quote (') beside the value also have this issue. I am not sure why this funny character will come out.

I got git push / dropbox sync, two different environment working with (Windows / Mac OSX). It request extra careful during with encoding issue.

The solution for me are:

  1. Encoding -> Convert to ANSI
  2. Fix / Erase the funny / weird character
  3. Encoding -> Convert to UTF-8 without BOM
  4. Save
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top