Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a pdf containing the following code:

echo “**** Pulling changes into Dev [Hub’s post-update hook]”
case “ $1 ” in

If I copy and then paste that code on my terminal, after doing pico myhookname I get this:

echo ?^?^?**** Pulling changes into Dev [Hub?^?^?s post-update hook]?^?^?
case ?^?^? $1 ?^?^? in

How can we properly format the .pdf file so that, when we copy paste, we get the proper code on or file ?

Here is an image of how the pdf looks like:code snipped - pdf file

If the problem relies not on PDF but on the original program that have created this (inDesign in this case), does anyone know a way to insert code, so that when we copy paste, it just works ?

ps - Those as hooks btw, and it's very dummy to, each time I wish to start a development, I have to write on hand all necessary hooks. :/

share|improve this question
The creator of the PDF document allowed changing the quotation marks into typographical (non-straight) variants (compare " and “ or ”), so the PDF contents are already broken, even if your Terminal or editor handled those properly. Start by getting good script code first. – Daniel Beck May 20 '12 at 16:25
I guess the original file was created in InDesign. So the problem must rely on that program, or is there any option on .pdf export in order to keep things straight ? – MEM May 20 '12 at 16:29
InDesign probably converted those in an attempt to "fix" the laziness of authors not bothering to use typographical quotation marks. Also, I think Super User does the same thing and broke my example, so here's the second try: " vs. “”. – Daniel Beck May 20 '12 at 16:35
@Daniel Beck - Actually, I believe typographical quotation was indeed used.I've update my question with an snapshot image of the pdf contents text. – MEM May 20 '12 at 16:40
Then you'll have to do a simple search and replace for all typographic quotes. – slhck May 20 '12 at 16:44

Use straight quotation marks (" ") when you’re typing code. (...) In InDesign, you can change a preference setting to determine which quotation marks are used. You can read more about it in the Use quotation marks Help topic.


If you can't have access to the original file and still want to fix the quotes related issues, you can copy paste your contents to Text Wrangler application and choose Text > Straighten Quotes

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .