calvin-brand-light-mode
calvin-brand-dark-mode
∕
⌘K
About Calvin Podcast We Can Do This Book Speaking
aAbout Calvin
Podcast
wWe Can Do This Book
sSpeaking
Back

Find all ruby files with special characters that don't yet have the # encoding magic comment set

Other
Calvin Correli·Dec 8, 2011· 1 minute
I'm playing with upgrading zenbilling to Ruby 1.9.3, and need to add the magic encoding comment to the source files that need it. Here's my poor man's way of doing it in the shell: grep "[ÆØÅæøå]" `grep -rL "^# encoding" ./**/*.rb` It's searching for the presence of one of the Danish characters in any ruby file that doesn't have the # encoding magic comment. I guess I could've also just added the comment to all files. I didn't. Anyway, the command is here in case you need it.
Previous A heckuva job
Next Our survival skills become our talents

Comments

Write a comment...
00:00 Recording...
calvin-brand-light-mode
calvin-brand-dark-mode
1 Chestnut Hill Plaza #1139
Newark, DE 19713
United States
Copyright © 2026 Calvin Correli
powered by