Moodle

Lang files contain quite a few BOM markers

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Component/s: Language
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Using Eloy's grep trick on the lang files revealed a lot of BOM markers. I assume they don't cause any problems in html files, but I think that the php files can be a problem.

For absolute vi dummies like me, the solution looks like
grep -rl $'\xEF\xBB\xBF' * //Search folder and subfolders for BOM markers
vim filename //opens file in vim
:set nobomb //removes the BOM
:w //saves the file with the same name
:q //quit vim

(credits to Eloy and http://www.tuxfiles.org/linuxhelp/vimcheat.html)

to perform on a *nix or a mac.

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Perhaps, "bom_out.sh" is your script! MDL-10637

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Perhaps, "bom_out.sh" is your script! MDL-10637 Ciao
Hide
Koen Roggemans added a comment -

Great script - to run as executable file in stead of sh bom_out.sh to make it work on my Linux

Show
Koen Roggemans added a comment - Great script - to run as executable file in stead of sh bom_out.sh to make it work on my Linux
Hide
Koen Roggemans added a comment -

I couldn't find a single corrupted file due to the deletion of the BOM by using Eloy's script. As long as it concerns text files (no binary files) it should be ok to run it and commit to CVS, although being careful is always allowed

Show
Koen Roggemans added a comment - I couldn't find a single corrupted file due to the deletion of the BOM by using Eloy's script. As long as it concerns text files (no binary files) it should be ok to run it and commit to CVS, although being careful is always allowed

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: