Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a pdf containing the following code:

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

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

#!/bin/sh
echo
echo ?^?^?**** Pulling changes into Dev [Hub?^?^?s post-update hook]?^?^?
echo
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
1  
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
show 2 more comments

1 Answer

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.

reference: http://blogs.adobe.com/indesigndocs/2009/05/5_typing_rules.html

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.