Textutils request

May 29, 2008
572
4
Groton, CT
Charles Dye,

Would you consider providing a way for @UQUOTES and WRAP to suppress replacing a double hyphen with an em dash?
Perhaps supply an environment variable which is the string that replaces the double hyphen, default to the em dash. I would set it a single hyphen for my purposes.


Tnx,
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
I'm reviewing the source and it looks like you've already got it; set a variable EMDASH to the character (not string) you want. You can specify it either as a literal character, or as a decimal or hexadecimal value.

Dunno how I managed to document the obscure ones, and miss that....
 
May 29, 2008
572
4
Groton, CT
Thanks, Charles, but it doesn't work.

I just tried using
set emdash=0x002D
and it does not work. The actual emdash character 0x0097 appears in the output where two occurrences of 0x002D appear in the input.

I also tried setting EMDASH to 0x2D and a literal hyphen, and none worked.
 
May 20, 2008
12,167
133
Syracuse, NY, USA
Charmap says

upload_2017-1-31_17-31-5.png


Exactly what does that mean?
 
May 29, 2008
572
4
Groton, CT
I downloaded the new version.

WRAP now works correctly:
Code:
~\Work> unset emdash

~\Work> echo abcde--fgh > x.tmp

~\Work> WRAP /f:2 /c:1 /P:2,2 /W:69 /Q x.tmp > y.tmp

~\Work> set emdash=0x2D

~\Work> WRAP /f:2 /c:1 /P:2,2 /W:69 /Q x.tmp > z.tmp

~\Work> type /x y.tmp
0000 0000 20 20 61 62 63 64 65 97  66 67 68 0d 0a             abcde—fgh..

~\Work> type /x z.tmp
0000 0000 20 20 61 62 63 64 65 2d  66 67 68 0d 0a             abcde-fgh..

But, @UQUOTES still fails:
Code:
~\Work> unset  emdash

~\Work> echo %@uquotes[zyxwv--uts] > y.txt

~\Work> set emdash=0x2D

~\Work> echo %@uquotes[zyxwv--uts] > z.txt

~\Work> type /x y.txt
0000 0000 7a 79 78 77 76 97 75 74  73 0d 0a                 zyxwv—uts..

~\Work> type /x z.txt
0000 0000 7a 79 78 77 76 97 75 74  73 0d 0a                 zyxwv—uts..

I'm happy, because I'm using WRAP, and @UQUOTES isn't affecting me right now.
Thanks, Charles
 
Last edited:
May 20, 2008
12,167
133
Syracuse, NY, USA
OK, I get it. (Doh!). So the emdash is 0x2014 (Unicode, AndaleMono); I can see it here. What's the 0x0097 that Dave spoke of?
 

Similar threads