last day (15 days later) » 

10:54 PM
28
A: Count the bytes of a program

Digital TraumaShell + coreutils, 6 wc -mc Test output: $ printf '%s' "(~R∊R∘.×R)/R←1↓ιR" | ./count.sh 17 27 $ In case the output format is strictly enforced (just one space separating the the two integers), then we can do this: Shell + coreutils, 12 echo`wc -mc` Thanks to @immibis for s...

 
@immibis Yes - nice - I couldn't see how that worked right away.
 
This assumes an UTF-8 locale. You should include the code to set up such a locale.
 
@FUZxxl The default locale is en_US.UTF-8 on my default install of Ubuntu. Do you really think it's necessary to add code to restate this explicitly? Perhaps a meta question...
 
@DigitalTrauma My default locale is de_DE@euro which uses ISO 8859-15. Yes, it's necessary in my opinion.
 
@FUZxxl What distro are you using? Is de_DE@euro the default locale set at install time? I claim that en_US.UTF-8 is the default locale set at install time for Ubuntu (very "mainstream" distro). Likely this default is same for the significant majority of other "mainstream" distros.
 
10:54 PM
@DigitalTrauma Actually, Ubuntu asks you which locale to set at install time. The default locale is C or POSIX according to IEEE 1003.1 and that one doesn't do Unicode.
 
@FUZxxl Are you sure about the "doesn't do Unicode" part? I've done many default Ubuntu installs (mostly VMs) and never explicitly changed locale at install time. Unicode (UTF-8) has always just worked out of the box. Output from locale is all LC_*="en_US.UTF-8"
 
@DigitalTrauma It's a checkbox during the text install and the very first question (language) in a GUI install. Easy to miss or ignore.
 
But if you leave all the defaults, you should end up with en_US.UTF-8
I'm trying it now
I even set location to be Berlin...
but I didn't change the default language option of US english
 
If you leave language to English that is
anyway, if you leave everything at default, you can't even complete the installation as you need to type a user name.
 
which is the deafult
 
10:56 PM
you are grasping at straws here
 
I disagree
 
it's the same situation with the perl -e switch which also counts as an extra character.
 
username and password must be set - there are no default values for these fields
 
so you have to deviate from the default somewhere.
 
whereas the default option is US English
you have to choose something else if you want something else
 
10:59 PM
Okay. I accept your reasoning if you change the language to “Ubuntu <version>, command line utilities«
or something like that
I still don't like it
 
pretty sure its the same for Centos
 
depends on how you install centos
 
probably most of the other "big" distroes
 
probably makes a good meta question
 
certainly country-specific distros will have different defaults
 
11:00 PM
anyway, the only standard I know of mentions C as the default locale (and that's in fact what FreeBSD sets as the default)
 
yes - I'm drafting up a meta question now
FWIW, I'd usually be the last person to argue for "American Exceptionalism" ;-)
 
except if it makes you win a challenge of course
 
haha
Please comment or edit if you think I've written this to be too biased towards my point of view
and of course please add an answer
I put this right at the top of my answer:
> As discussed here, this answer becomes invalid if an encoding other than UTF-8 is used.
is that ok?
 
Yes. As of now, I'm adding some resolution approaches so people have choice. Please do so, too.
 
ok
FYI - those downvotes are not mine ;-)
I'm abstaining from voting on this
Gotto go offline now
ttyl
 
11:17 PM
see you
 

last day (15 days later) »