Dealing with cyrillic comments in your code with iconv
So you inherit some code from a russian predecessor who was coding in Windows. Predictably, the comments are in russian, and the encoding is CP-1251 (or koi-8, who knows). Here’s what you do:
mkdir conv
find . -type f -name '*.php' -exec bash -c 'iconv -f windows-1251 -t utf-8 "{}" > ./conv/"{}"' \;
then just copy the files from the new ./conv/ directory into their proper locations, run a git diff or something to make sure you didn’t mess anything up, and commit.
Written by Anton Stroganov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#