text:
Convert YYYYMM to MMMYY
Basing on this SO question.
Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY.
Rules:

The input will be a number or a string exactly 6 characters long, consisting only of digits.
Last two digits will be between 01 and 12.
Output must be in the form MMMYY, where MMM represents uppercase three-letter code for the month (below) and YY represents two last digits of the YYYY part of the input.

List of months with corresponding code:
MM    MMM
01    JAN
02    FEB
03    MAR
04    APR
05    MAY
06    JUN
07    JUL
08    AUG
09    SEP
10    OCT
11    NOV
12    DEC

Examples:
Input     Output
201604    APR16
200001    JAN00
000112    DEC01
123405    MAY34

This question is very well-balanced. Both manual parsing and date libraries end up being about the same, at least in Python.

Yesterday, I saw "Convert YYYYMM to MMMYY" on HNQ beside the SO logo. Now I see the same title beside the PCG logo. I was very confused :)

MATL, 18 14 13 bytes
4e!Z{Zc12XOXk

Input is provided as a string (enclosed in single quotes).
This version only runs in MATL on MATLAB since MATLAB is able to automatically parse datestr('2016 04').
Explanation
        % Implicitly grab input as a string
4e!     % Reshape input to be 2 x 4 (puts the year in row 1 and month in row 2)
Z{      % Place each row in a separate cell
Zc      % Join them together using a space to create 'yyyy mm' format
12      % Number literal, pre-defined datestring of 'mmmyy'
XO      % Convert from serial date number to string using this format
Xk      % Convert to uppercase
        % Implicitly display

Here is an 18 byte version which works on Octave (and therefore the online interpreter)
'yyyymm'2$YO12XOXk

Try it Online
Modified version for all test cases
Explanation
            % Implicitly grab input as a string
'yyyymm'    % Push the format string as a string literal
2$YO        % Convert to a serial date number
12          % Number literal, pre-defined datestring of 'mmmyy'
XO          % Convert from serial date number to string using this format
Xk          % Convert to uppercase
            % Implicitly display

I don't see how this can be beaten so.. gg

Python 3, 70 bytes
from time import*
lambda s:strftime("%b%y",strptime(s,"%Y%m")).upper()

This uses the built-in strftime and strptime functions.
For 1 byte more, here's a version which parses the string manually:
lambda s:" JFMAMJJASONDAEAPAUUUECOENBRRYNLGPTVC"[int(s[4:])::12]+s[2:4]

This encodes the month names in an interesting way (thanks to Henry Gomersall for saving a byte).

That manual parsing is crazy.

@MorganThrapp I got the idea from this answer.

Ugh I was going to do exactly your 72 byte answer +1

Your manual version can be done in 69 bytes in Python 2 if you take a number as input: lambda n:"JFMAMJJASONDAEAPAUUUECOENBRRYNLGPTVC"[n%100-1::12]+`n`[2:4].

@xnor Would that work for the 000112 example?

@Neil Oh, it wouldn't work there.

Though this loses a byte: lambda s:" JFMAMJJASONDAEAPAUUUECOENBRRYNLGPTVC"[int(s[4:])::12]+s[2:4]

Why not simply import time?

@a25bedc5-3d09-41b8-82fb-ea6c353d75ae - "import time" would save you 6 characters, but would cost you 10 ("time.", twice)

PowerShell, 49 46 40 bytes
date "$args".insert(4,'-')-U %b%y|% *per

Try it online!
Thanks to @Joey for saving 3 bytes!
Takes input $args as an explicit string (e.g., '201604') via command-line input. Uses the string.Insert() function to put a - in the appropriate space, and that resultant string forms input to the Get-Date cmdlet with the -Uformat parameter specifying the three-month shorthand plus two-digit year. We then tack on a .ToUpper() to make the output string capitalized. That string is left on the pipeline and printing is implicit.
Also, as pointed out, this is locale-sensitive. Here's the locale information that I'm using where this works correctly.
PS C:\Tools\Scripts\golfing> get-culture

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

You don't need to quote the MMMyy, since it's a simple argument to a cmdlet. You also could just use -UFormat %b%y, i.e. -u %b%y instead, which is even shorter. Side note: This solution is locale-sensitive (which I personally dislike), but would be a fair bit longer to account for that, admittedly.

Excellent call with the -UFormat instead. Thanks! I also did not know about the quotes around MMMyy - that's good to know for the future.

Bash + coreutils, 18
Requires 64-bit version of date for the given testcases, which recognises dates earlier than 14th December 1901.
date -d$101 +%^b%y

Retina, 71 70 bytes
Thanks to Sp3000 for saving 1 byte.
Byte count assumes ISO 8859-1 encoding. The trailing linefeed is significant.
(..)(..)$
DECNOVOCTSEPAUGJULJUNMAYAPRMARFEBJANXXX$2$*¶$1
+`...¶

R-6`.

Try it online!
Explanation
Taking 201604 as an example:
(..)(..)$
DECNOVOCTSEPAUGJULJUNMAYAPRMARFEBJANXXX$2$*¶$1

This swaps the last two digits of the year with the month while also expanding the month in unary using linefeeds, and prepending the list of months in reverse so we'd get:
20DECNOVOCTSEPAUGJULJUNMAYAPRMARFEBJANXXX¶¶¶¶16

Where the ¶ represent linefeeds (0x0A).
+`...¶

Now we repeatedly remove three non-linefeed characters followed by a linefeed. That is we eat up the list of months from the end for each linefeed representing a month:
20DECNOVOCTSEPAUGJULJUNMAYAPRMARFEBJANXXX¶¶¶¶16
20DECNOVOCTSEPAUGJULJUNMAYAPRMARFEBJAN¶¶¶16
20DECNOVOCTSEPAUGJULJUNMAYAPRMARFEB¶¶16
20DECNOVOCTSEPAUGJULJUNMAYAPRMAR¶16
20DECNOVOCTSEPAUGJULJUNMAYAPR16

This is why we've inserted that XXX: since the months start counting from 1, we'll always remove at least three characters, even for January.
R-6`.

Finally, we remove everything up to the 6th character from the end. In other words we only keep the last five characters.

That's pretty dang clever.

CJam, 50 46 bytes
q2/1>~i("4H~0ë~³!ò²×¶7Ö"256b25b'Af+3/=\

Try it online. Thanks to Martin Ender for compressing the string to save a few bytes.
Explanation
q2/  e# Get input and divide it into groups of 2, like ["20" "16" "04"]
1>~  e# Discard the first item and dump the remaining array to the stack
i(   e# Convert the top value (month) to an integer and decrement it, because
     e# arrays are zero-indexed
"..."256b25b e# Convert this string from base-256 to base-25
'Af+ e# "Add" a capital A to each number to get the letters
3/   e# Divide into groups of 3 to make an array of month names
=\   e# Get the requested month and swap the elements to put the year on
     e# top, so it is printed last

Java 7, 137 characters (161 bytes)
String d(String i){return Integer.toString("憯䷳烣㘿烪摿摽㛨近筍矯䏔".charAt(Integer.parseInt(i.substring(4))-1),36).toUpperCase()+i.substring(2,4);}

Consider each month name (JAN, FEB etc...) is a number in base 36 and encode it into corresponding Unicode symbol. Then get corresponding symbol from the string encode it back again in base 36 and after that some plain string manipulations.
Slightly ungolfed:
String d(String input){
return
  Integer.toString("憯䷳烣㘿烪摿摽㛨近筍矯䏔" // encoded month names
  .charAt(Integer.parseInt(input.substring(4))-1),36) // get a symbol from encoded names at position input[4:], decode it to base 36 value
  .toUpperCase()+input.substring(2,4); // get it to upper case and add year
}

You can see it running here: https://ideone.com/IKlnPY

MATLAB / Octave, 42 bytes
@(x)upper(datestr(datenum(x,'yyyymm'),12))

Creates an anonymous function named ans that is called with a string representing the date: ans('201604').
Online Demo
This solution uses datenum to convert the input date to a serial date number, and then datestr with the predefined output spec of mmmyy (12) to yield the string representation in the required format. Finally, we use upper to change it to MMMYY since the uppercase month is not an output option.

Wow, gj on beating everyone else in a non-golfing language!

Bash, 39 28 bytes
date -d$101 +%b%y|tr a-z A-Z

Thanks Digital Trauma!

05AB1E, 51 42 41 bytes
2ô¦`ï<•r–ºþ¯Bê€õaPù£—^5AºüLwÇ–è•35B3ôsèsJ

Explanation
                                           # implicit input, 123405
2ô                                         # split input into pieces of 2, ['12','34','05']
  ¦`                                       # push last 2 elements to stack, '05', '34'
    ï<                                     # convert month to its int index, 4
      •r–ºþ¯Bê€õaPù£—^5AºüLwÇ–è•35B        # get compressed string containing 3-letter months,
                                             JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
                                   3ô      # split into pieces of 3
                                             ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
                                     sè    # get month at index retrieved earlier, MAY
                                       sJ  # join with 2-digit year and implicitly print, MAY34

Try it online
9 bytes saved thanks to string compression, courtesy of @Adnan

•r–ºþ¯Bê€õaPù£—^5AºüLwÇ–è•35B instead of "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC" saves 9 bytes.

JavaScript, 87 84 80 79 bytes
x=>(new Date(x.replace(/.{4}/,'$&-'))+'').slice(4,7).toUpperCase()+x.slice(2,4)

To get the month, gets the date (which is formed of "YYYYMM" converted to "YYYY-MM") and retrieves the characters 5 to 8, that are exactly the first three letters of the month. But it costs much to convert it to upper case.
Demo:

function s(x) {
  return (new Date(x.replace(/.{4}/, '$&-')) + '').slice(4,7)
         .toUpperCase() + x.slice(2, 4)
}

console.log(s('201604'));
console.log(s('200001'));
console.log(s('000112'));
console.log(s('123405'));

First should be APR16

@Upgoat And what's appearing for you?

I'm getting MAR16

@Upgoat Huh, that's weird, why could it be this way? Because I get this.

For me it does show APR16, but the third test case shows only DEC for me.

That's really strange, could you share the whole Date object you get? So as I could see what's happening.

OK in FF, Bad in Edge and Chrome for me.

Check the recent edit. @Enigna, what do you get?

Now they're all OK.

@Adnan Check the edit, please - should be fine now. Can't figure that oddness with March though.

Yes, it works now :).

@Upgoat What browser were you using?

@Emigna Does it work in all the browsers you've mentioned? (sorry for misspelling you the first time!)

Yes, it works in the 3 browsers I mentioned.

Could you, um, replace x.replace(/.{4}/,'$&-') with x.replace(/..$/,'-$&')?

JavaScript ES6, 77 66 bytes
Saved 11 bytes thanks to @Bálint!
a=>(new Date(0,a[4]+a[5]-1)+"").slice(4,7).toUpperCase()+a[2]+a[3]

Get's the date by extracting the string returned by the Date class. then capitalizes and adds the year.
ES5 version:

var a = prompt("Enter YYYYMM: ");
result = (new Date(0,a[4]+a[5]-1)+"").slice(4,7).toUpperCase()+a[2]+a[3]
alert(result);

I made one in 66 bytes with the same atob technique, but I can't copy it out

@Bálint I thought I got 66 bytes too but turns our byte counter was wrong due to to bad copy pasting ;)

You could get the month's name with (Date(0,a[4]- -a[5])+"").substr(4,3)

Or (new Date(0,a[4]- -a[5])+"").substr(4,3)

@Bálint oh wow, thanks! That's short!

I don't get that a[4]- -a[5]. What was wrong with a[4]+a[5]-1?

You can cut one more character by turning (new Date(0,a[4]- -a[5])+"") to (new Date(0,a[4]- -a[5])+1)

Also - just doing new Date(a[4]+a[5]) generates valid month (at least in Chrome)

Wrong for me 201604 -> MAY16

@edc65 Whoops should be fixed now

@Guedes yeah >_> the months were one off fixed in same number of bytes by just subtracting one

Nice work. My first impulse was to do it all with strings, but the shortest I could make it was still 76 bytes: d=>'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.substr(d.slice(4)*3-3,3)+d[2]+d[3]

new Date(0,a[4]+a[5]-1)+"" => new Date(0,a[4]+a[5]-1)+0

a[4]+a[5]-1 => a%100-1

Python, 83 bytes
from datetime import*
lambda x:datetime.strptime(x,'%Y%m').strftime('%b%y').upper()

I just posted an answer nearly identical to yours. I didn't see yours because it took a while to write the answer. If you want me to delete mine, I will, or you can use mine to get some extra bytes off.

That's fine, you beat me by 13 bytes, I'll concede. I like your manual answer, too.

Kotlin, 100 bytes
fun f(d:String)=SimpleDateFormat("MMMyy").format(SimpleDateFormat("yyyyMM").parse(d)).toUpperCase()

Pretty straight forward use of Java SimpleDateFormat

Hmm, I don't know Kotlin, but since it's derived from Java, shouldn't you include the import of the SimpleDateFormat (i.e. import java.text.*;)?

Since the challenge asks for output, I would assume a print is required as part of your function.

Julia, 57 56 53 bytes
s->uppercase(Dates.format(DateTime(s,"yyyym"),"uyy"))

This is an anonymous function that accepts a string and returns a string. To call it, assign it to a variable.
First we construct a DateTime object using the type constructor and a format string. Note that the single m in the format string will get both one- and two-digit months, though the former case is irrelevant here. Since no days are specified, the first of the month is assumed.
We can then format the value as a string using the Dates.format function from the Base.Dates submodule. The string uyy gets the three-letter month name and two-digit year, but the result is in title case, e.g. Apr16 instead of the desired APR16, so we need to uppercase it.
Try it online! (includes all test cases)

C, 147 145 112 bytes
main(m){char a[99]="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";scanf("%4s%d",a+50,&m);printf("%.3s%s",a+--m*3,a+52);}

Online demo
Thanks ugoren!

Some cheap tricks - delete the #include, define m as a parameter - main(m),

Also, the %.3s format saves the null termination.

Thanks @ugoren! I also changed "%4s%2d" to "%4s%d".

main(m){char a[9];scanf("%4s%d",a,&m);printf("%.3s%s","JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"+--m*3,a+2);} lot shorter

C#, 94 87 bytes
string C(string s)=>System.DateTime.Parse(s.Insert(4,"-")).ToString("MMMyy").ToUpper();

Saved 7 bytes by using C#6 Syntax.
Try Online

You can leave off return type information for lambdas, i.e C(string s)=>...

Japt, 35 34 bytes
ÐUr$/..../$,"$&-")+P s4,7 u +Us2,4

Link.
Uses the same technique as my JavaScript answer.

Java 8, 154 113 bytes
import java.text.*;s->new SimpleDateFormat("MMMyy").format(new SimpleDateFormat("yyyyMM").parse(s)).toUpperCase()

Explanation:
Try it online.
import java.text.*;                 // Required import for SimpleDateFormat
s->                                 // Method with String as both parameter and return-type
  new SimpleDateFormat("MMMyy")     //  Create a formatter with format "MMMyy"
   .format(                         //  Format the following:
     new SimpleDateFormat("yyyyMM") //   Create another formatter with format "yyyyMM"
     .parse(s))                     //   Parse the input with this format
  .toUpperCase()                    //  Convert everything to Uppercase and return

I think you can shorten it if you remove the import and instead directly refer to it with java.text.SimpleDateFormat.

@Frozn Actually, import java.text.*; is 19 bytes, and two times java.text. in front of both SimpleDateFormat is 20 bytes. So it would increase by 1 byte instead of lowering it.

Oh yea you're right. I always look at the ungolfed version and think that it's equal to the golfed one. Sorry :)

@Frozn Ah, also a bit my bad. Usually I still use .*; for the ungolfed code, but this time I seem to have neglected it. I have save options that automatically converts it to pure imports since I use Java in my job, and I simply forgot to change it to import java.text.*;..

Pyth, 45 bytes
+:."AYw2ûDÈëKH§È¼DYÉx\E±oË"J*3sgz5+3J:z2 4

Try it online!
Explanation:
+:."AYw2ûDÈëKH§È¼DYÉx\E±oË"J*3sgz5+3J:z2 4
                                z           Take the input
                               g 5          Slice inclusively from index 5 to the end
                              s             Parse as an int
                            *3              Multiply by 3
                           J                Store in variable J, this also returns J
 :                                          Take a slice
  ."AYw2ûDÈëKH§È¼DYÉx\E±oË"                 Of this packed string
                           J*3sgz5          From the J we defined before
                                  +3J       To J+3
+                                           To this string, append
                                     :z     A slice of the index
                                       2 4  From [2,4).

The packed string contains "JANJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC". The two JANs are so that I can index it pseudo-one-indexed.
EDIT: Fixed bug that was messing with TIO

Microsoft SQL Server, 57 Bytes
SELECT UPPER(FORMAT(CAST('201601'+'01' AS DATE),'MMMyy'))

The Upper function is required as format does not produce Upper case months as would be expected with the MMM format pattern.
Usage:
drop table t;
create table t (n VARCHAR(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');

SELECT UPPER(FORMAT(CAST(n+'01' AS DATE),'MMMyy')) FROM t

Just saw your answer, it is alot like mine, didn't notice it until now, removed my answer

Is it allowed to take input from a table? The codegolf tag info suggests that no.

@pajonk the answer here doesn't use input from a table, the answer is the top line and the input variable is hardcoded. Note that you can use tables as input variables as i mention earlier. The bottom part is an example how to convert several values. TSQL doesn't have STDIN nor input statements. Only way of adding data is using variables or tables. All of my answers are using those for input

Ok, thanks for clarifying.

Oracle SQL, 49 Bytes
select to_char(to_date(n,'yyyymm'),'MONyy')from t

The data must be inserted in a table called T with a column N of type VARCHAR2(6), CHAR(6) or , only if all the years are > 1000,  NUMBER
Usage:
drop table t;
create table t (n VARCHAR2(6));
insert into t values ('201604');
insert into t values ('200001');
insert into t values ('000112');
insert into t values ('123405');

select to_char(to_date(n,'yyyymm'),'MONyy')from t;

Would it be possible to use PRINT instead of SELECT and not refer to the table using a variable as input instead ? Declaring input variable and assigning the value does not affect the byte count

Is it allowed to take input from a table? The codegolf tag info suggests that no.

@t-clausen.dk the shortest way using print is 58 chars: begin:n:=to_char(to_date(:n,'yyyymm'),'monyy');end;print n and you need 42 extra chars for a single input(VARIABLE n varchar2;BEGIN:n:='201605';END;) instead of 31 (insert into t values('000112');) if you have shorter ways please tell me.

@pajonk in this answer nobody tell me anything about the use of tables

@pajonk according to this, you can use tables for input

Ok, just wanted to know. Thanks for clarification.

Microsoft Excel VBA, 47 Bytes
Anonymous VBE immediate window function that takes input from range [A1] and outputs to the VBE immediate window
?UCase(MonthName([Right(A1,2)],1))[Mid(A1,3,2)]

Current version thanks to @Engineer Toast, for pointing out the abbreviate option of the MonthName function.
Previous Version
?UCase(Format(DateSerial([Left(A1,4)],[Right(A1,2)],1),"MMMYY"))

Worth noting that Excel needs to be set to English, otherwise it returns locale-specific month name.

48 bytes: ?UCase(MonthName(Right([A1],2),1))&Mid([A1],3,2)

Turns out the Excel formula can be 46 bytes: =UPPER(TEXT(RIGHT(A1,2)*28,"MMM"))&MID(A1,3,2)

MediaWiki Template (with ParserFunctions), 29 bytes
{{uc:{{#time:My|{{{1}}}01}}}}

Only works if English locale is chosen.
Try Sandbox

R, 65 bytes
function(A)paste0(toupper(month.abb[el(A:1)%%100]),substr(A,3,4))

Try it online!
Takes input as a string, leverages the constant month.abb. Uses modulus and substr to extract relevant values.

clever use of : to convert to integer!

@Giuseppe Not my idea :) I took it from here. I can probably apply it to a number of my existing answers!

@Giuseppe I just found a shorter hack using el - 1 less byte.

Perl 5 -p, 75 bytes
$_=(1,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC)[/..$/g].substr$`,2,2

Try it online!

Japt -P, 14 13 bytes
ÐUò4)Åu ¸o¤Åë

Try it
ÐUò4)Åu ¸o¤Åë     :Implicit input of string U          > "201604"
Ð                 :Create Date object from
 Uò4              :  Partitions of U of length 4       > ["2016","04"]
    )             :End Date
     Å            :To date string                      > "Fri Apr 01 2016"
      u           :Uppercase                           > "FRI APR 01 2016"
        ¸         :Split on spaces                     > ["FRI","APR","01","2016"]
         o        :Modify the last element
          ¤       :  Slice off the first 2 characters  > ["FRI","APR","01","16"]
           Å      :Slice off the first element         > ["APR","01","16"]]
            ë     :Get every second element            > ["APR","16"]
                  :Implicitly join and output          > "APR16"

Flagless 14 bytes: ÐUò4)Å¸ó Ìo¤¬u

JavaScript (Node.js), 78 bytes
i=>'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.match(/.../g)[i[4]+i[5]-1]+i[2]+i[3]

Try it online!

Headascii, 331 bytes
UUU^U[UOUODOD]ONE.++++[]]]][]]]]+O[---[]]]][]]]][U]^U]OUOUOD++E.+++^^^U[U-()D]^P(]PD++++P:-()+++++]P-P---P:-()D+++]^P(]PD+++++P:-()]PD++++++]P++P:-()D^^^+++]P(]PD---]P:-()D^^]PD^++]PD-----]P:-()D^^]PD++]P(++^^^^^D+]P:-()]PD^^D++]P(++++++]P:D^^D^]P(++++]PD---]P;UPUP!.++^^^^^U[U)D^^++++]P(++]PD-]P:R-)D^^+++]P+PD+]P:+++]P+P--P;UPUP!

Try it here! Code will need to be pasted in and executed like this:
erun("UUU^U[UOUODOD]ONE.++++[]]]][]]]]+O[---[]]]][]]]][U]^U]OUOUOD++E.+++^^^U[U-()D]^P(]PD++++P:-()+++++]P-P---P:-()D+++]^P(]PD+++++P:-()]PD++++++]P++P:-()D^^^+++]P(]PD---]P:-()D^^]PD^++]PD-----]P:-()D^^]PD++]P(++^^^^^D+]P:-()]PD^^D++]P(++++++]P:D^^D^]P(++++]PD---]P;UPUP!.++^^^^^U[U)D^^++++]P(++]PD-]P:R-)D^^+++]P+PD+]P:+++]P+P--P;UPUP!","your input here")

Headass/ascii is not particularly good at strings.
UUU^U[UOUODOD]ONE. Block 0

UU                 Discard the first two chars of input lol
  U^U[             Hold onto the last two digits of the year
      UOUODOD]O    ready MMYY for the next code block
               NE  Go to block 1
                 . Block separator

++++[]]]][]]]]+O[---[]]]][]]]][U]^U]OUOUOD++E. Block 1

++++[]]]][]]]]+O                               Save 65 for later ease of access
                [---[]]]][]]]][                -48
                               U]^             Add to first month digit and hold
                                  U]O          Add to second month digit and save
                                     UOUO      Save year digits
                                         D++E  Go to either block 1 or block 2,
                                                depending on whether the first
                                                digit of the month was 0 or 1
                                             . Block separator

+++^^^U[U-()...;UPUP!.      Block 2 (JAN-SEP)

+++^^^                      Store 9 on the accumulator
      U[                    Restore 65 from earlier
        U-()                If the second digit of the month is 1,
D]^P(]PD++++P                 Concatenate "JAN" to the string register
             :-()           Else if it's 2
+++++]P-P---P                 Concatenate "FEB" to the string register
             :-()           Else if it's 3
D+++]^P(]PD+++++P             Concatenate "MAR" to the string register
                 :-()       Else if it's 4
]PD++++++]P++P                Concatenate "APR" to the string register
              :-()          Else if it's 5
D^^^+++]P(]PD---]P            Concatenate "MAY" to the string register
                  :-()      Else if it's 6
D^^]PD^++]PD-----]P           Concatenate "JUN" to the string register
                   :-()     Else if it's 7
D^^]PD++]P(++^^^^^D+]P        Concatenate "JUL" to the string register
                      :-()  Else if it's 8
]PD^^D++]P(++++++]P           Concatenate "AUG" to the string register
                   :        Else
D^^D^]P(++++]PD---]P          Concatenate "SEP" to the string register
               ;UPUP!       Then concatenate the year digits from earlier and print!
                     .      Block separator, end of execution

++^^^^^U[U)D^...;UPUP!  Block 3 (OCT-DEC)

++^^^^^                 Store 10 on the accumulator
       U[               Restore 65 from earlier
         U)             If the second digit of the month is 0,
D^^++++]P(++]PD-]P        Concatenate "OCT" to the string register
                  :R-)  Else if it's 1
D^^+++]P+PD+]P            Concatenate "NOV" to the string register
              :         Else
+++]P+P--P                Concatenate "DEC" to the string register
          ;UPUP!        Then concatenate the year digits from earlier and print!

x86-16 machine code, 64 bytes
00000000: fcad ad50 ad2d 3030 86e0 d50a be19 0103  ...P.-00........
00000010: f003 f003 f02e a52e a458 abc3 4a41 4e46  .........X..JANF
00000020: 4542 4d41 5241 5052 4d41 594a 554e 4a55  EBMARAPRMAYJUNJU
00000030: 4c41 5547 5345 504f 4354 4e4f 5644 4543  LAUGSEPOCTNOVDEC

Callable function, input at DS:SI, output buffer at ES:DI.
Listing:
FC          CLD                         ; string direction forward
AD          LODSW                       ; skip first two chars
AD          LODSW                       ; load YY string
50          PUSH AX                     ; save YY string
AD          LODSW                       ; load month string
2D 3030     SUB  AX, '00'               ; ASCII convert month
86 E0       XCHG AH, AL                 ; endian convert
D5 0A       AAD                         ; word convert to index (1-12)
BE 0116     MOV  SI, OFFSET MTBL[-3]    ; month table (1-indexed)
03 F0       ADD  SI, AX                 ; add month offset * 3 chars
03 F0       ADD  SI, AX
03 F0       ADD  SI, AX
2E A5   CS: MOVSW                       ; copy first two bytes of month
2E A4   CS: MOVSB                       ; copy third byte of month to output
58          POP  AX                     ; restore YY string
AB          STOSW                       ; write YY to output
C3          RET
        MTBL:
4A 41 4E    DB  'JAN'
46 45 42    DB  'FEB'
4D 41 52    DB  'MAR'
41 50 52    DB  'APR'
4D 41 59    DB  'MAY'
4A 55 4E    DB  'JUN'
4A 55 4C    DB  'JUL'
41 55 47    DB  'AUG'
53 45 50    DB  'SEP'
4F 43 54    DB  'OCT'
4E 4F 56    DB  'NOV'
44 45 43    DB  'DEC'

Sample runs:

Make it 62, as I guess you may want to add a CLD in front - otherwise direction is undefined.

In addition the code assumes that DS=CS which is only true in tiny model - which in turn doesn't need far input, does it? So to make it work the two MOVS* need a CS segment overwrite ... ending at 64 :))

@Raffzahn  just for that I'm not going to use MASM's long syntax for MOVS with segment override.

Fine with me - as long as the prefix gets generated.

Pyth, 39 bytes
Hexdump:
0000000: 2b 40 63 2e 22 41 59 12 56 0a 7c bd 93 e3 1c 07 +@c."AY.V.|.....
0000010: e3 d4 d9 ed 5b 49 02 cd b4 92 83 86 22 33 73 3e ....[I......"3s>
0000020: 32 7a 3a 7a 32 20 34                            2z:z2 4

Test suite.

jq, 35 characters
(34 characters code + 1 character command-line option.)
(Just tried whether the ^ trick used by Digital Trauma in his Bash answer works in jq too. Works. Now you know who inspired the most important character of this answer. (The alternative is to use the ascii_upcase function.))
strptime("%Y%m")|strftime("%^b%y")

Sample run (Option -R used only in this sample to pass all test cases.)
bash-4.3$ jq -Rr 'strptime("%Y%m")|strftime("%^b%y")' <<END
201604
200001
000112
123405
END
APR16
JAN00
DEC01
MAY34

On-line test: (Passing -R through URL is not supported – so input passed as JSON string literal. Passing -r through URL is not supported – check Raw Output yourself.)

200001
000112

R, 154 150 114 112 bytes
Takes six digit input into "b", separates the first four digits from the last two digits, abbreviates the 2-digit month and makes it uppercase, and concatenates it with the 3rd and 4th digit.
Golfed:
function(b){h=substr;i=sprintf;o="%06d";cat(toupper(month.abb[as.numeric(h(i(o,b),5,6))]),h(i(o,b),3,4),sep="")}

Ungolfed:
function(b){
   h=substr;i=sprintf;o="%06d";

   cat(
      toupper(month.abb[as.numeric(h(i(o,b),5,6))]),
      h(i(o,b),3,4),
   sep="")
}

EDITS: replaced duplicitous names with variables; fixed me being stupid. -2 bytes by turning function anonymous (thanks, cat).

Nice answer! You can leave off the a= for an anonymous function

@cat I'm not too familiar with anonymous functions but wouldn't I need to add parentheses at the beginning and end of the function if I removed the a= ? Something like this:
(function(m) {a=3;m*a})(10)

Nope, function(b){h=substr;i=sprintf;o="%06d";cat(toupper(month.abb[as.numeric(h(i(o,b),5,6))]),h(i(o,b),3,4),sep="")} is a function object all on its own.

This doesn't appear to work. on RStudio with R 3.2.3 (2015-12-10) I get Error in i(o, b) : invalid format '%06d'; use format %s for character objects

@cat Darn new versions messing everything up! I'm on RStudio running R version 3.1.1 (2014-07-10) and it works fine. How does this work here, should I get the new version and change up the code? Also thanks for the anonymous function tip!

@cat this also works on R version 3.2.2 (2015-08-14)

I've edited your post to include data about the version

@cat it works perfectly well on R 3.2.5. The call to the function (if saved as function f) should be f(200612). The error you got implies you tried f("200612") instead.

PHP, 78 bytes
<?=fscanf(STDIN,"%4d%d",$y,$m)?strtoupper(date("My",mktime(0,0,0,$m,1,$y))):0;

The "year 2038 problem" may occur on some computers, as here. But not in others, as here.

@Titus, please don't try to edit other peoples' posts if there are problems and insert your own solutions; instead, please comment on the answer OR create a new answer yourself.

Factor, 82 78 bytes
[ [ 2 tail* 10 base> month-abbreviation ] [ 4 head 2 tail ] bi append >upper ]

Eshplained:
[                    ! new anonymouse function block (quotation)
  [                  ! new quotation
    2 tail*          ! "201604" -> "04"
    10 base>         ! "04"     -> 4
    month-abbreviation ! 4 -> "Apr"
  ]                  ! end quotation
  [                  ! new quotation
    4 head           ! "201604" -> "2016"
    2 tail           ! "2016"   -> "16"
  ]                  ! end quotation
  bi                 ! bifurcate two quotations to TOS
  append             ! "Apr" "16" -> "Apr16"
  >upper             ! "Apr16"    -> "APR16"
]                    ! end quotation

Swift 2.2, 149 bytes
let f = NSDateFormatter(),g = NSDateFormatter();f.dateFormat = "yyyyMM";g.dateFormat = "MMMyy"
g.stringFromDate(f.dateFromString(i)!).uppercaseString

Trying to get this shorter than Kotlin...  It's a shame NSDateFormatter doesn't have an initializer that sets its dateFormat.  NSDateFormatter also does not have a default dateFormat value, causing additional losses.
Swift 3, 136 bytes
let f = DateFormatter(),g = DateFormatter();f.dateFormat = "yyyyMM";g.dateFormat = "MMMyy"
g.string(from: f.date(from: i)!).uppercased()

Thanks to the removal of the NS prefix on some classes, I was able to make the Swift 3 answer a little shorter.  Still not shorter than Kotlin though...
Test function and cases:
import Foundation
import XCTest

func dateConverter(i: String) -> String? {
    let f = DateFormatter(),g = DateFormatter();f.dateFormat = "yyyyMM";g.dateFormat = "MMMyy"

    if let date = f.date(from: i) {
        return g.string(from: date).uppercased()
    }

    return nil
}

XCTAssert(dateConverter(i: "201604") == "APR16")
XCTAssert(dateConverter(i: "200001") == "JAN00")
XCTAssert(dateConverter(i: "000112") == "DEC01")
XCTAssert(dateConverter(i: "123405") == "MAY34")

Don’t you have to import Foundation in Swift 3? I’ve never used Swift 3 seriously, but I know you need that in Swift 5 at least.

J, 70 bytes
4(}.((,~(_3]\'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'){~1-~".)~2&}.){.)]

Usage
   f =: 4(}.((,~(_3]\'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'){~1-~".)~2&}.){.)]
   f '201604'
APR16
   f '200001'
JAN00
   f '000112'
DEC01
   f '123405'
MAY34

Explanation
4(}.((,~(_3]\'...'){~1-~".)~2&}.){.)] Input: s
                                    ] Identity function, gets the value s
4                                     The constant 4
                                 {.   Take the first 4 chars from s
                            2&}.      Drop the first 2 (Take the last 2) to get the year
  }.                                  Drop the first 4 chars from s to get the month
                        ".            Parse the month substring as a number
                     1-~              Subtract 1 from it
             '...'                    List of MMM month names
         _3]\                         Split the list into nonoverlapping sublists of size 3
      ,~                              Join the MMM month name with the year and return

SmileBASIC, 85 bytes
DEF C D?MID$(@__JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC,VAL(D[4]+D[4])*3,3);D[2];D[3]END

@__JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC is equivalent to the string literal "@__JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC". JAN starts at index 3, so the program can calculate the position as month*3 instead of (month-1)*3 or month*3-3.

C# - 75 Bytes
s=>{return new System.DateTime(s/100,s%100,1).ToString("MMMyy").ToUpper();}

K4, 65 59 bytes
Solution:
@[13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV";.*|x],*x:2 4_

Examples:
q)k)@[13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV";.*|x],*x:2 4_"201604"
"APR16"
q)k)@[13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV";.*|x],*x:2 4_"200001"
"JAN00"
q)k)@[13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV";.*|x],*x:2 4_"000112"
"DEC01"
q)k)@[13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV";.*|x],*x:2 4_"123405"
"MAY34"

Explanation:
Reshape the months of the year so that 0 => DEC and 1 => JAN ... 12 => DEC.
@[13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV";.*|x],*x:2 4_ / the solution
                                                       2 4_ / cut input at indices 2 & 4, "201604" => ["16", "04"]
                                                     x:     / save as x
                                                    *       / take first
                                                   ,        / join with
@[                                           ;    ]         / apply @[list;index]
                                               *|x          / reverse (|), first (*) aka 'last'
                                              .             / value ("05" => 5)
       "DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV"               / offset months of the year
  13 3#                                                     / reshape

Bonus:
60 byte version in K (oK):
((13 3#"DECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV")@.*|x),*x:2 4_

Try it online!

Caché ObjectScript - 65 bytes
Golfed
r i s d=$zcvt($zd($zdth(i_"01",8),6),"u") w $e(d,1,3)_$e(d,*-1,*)

Ungolfed
r i                            ; Read stdin and store into 'i'                      [200203]
   s d=                        ; Set the variable 'd' to the following...
       $zcvt(                  ; Convert the string
             $zd(              ; Parse the string as a caché date
                 $zdth(        ; Convert the date to horolog format (# days from 12/31/1840)
                       i_"01", ; Append the string "01" to variable 'i'             [20020301]
                       8       ; Use format #8 - "YYYYMMDD" (e.g. 20020301)
                      ),                                                            [58864,0]
                 6             ; Use format #6 - "Mmm [D]D YYYY" (e.g. Mar 1 2002)
                ),                                                                  [Mar 1 2002]
             "u"               ; Convert the string to uppercase
            )                                                                       [MAR 1 2002]
   w                           ; Write out the following...
     $e(d,1,3)                 ; Extract the substring from position 1 to 3 (inclusive) [MAR]
     _                         ; Concatenate
     $e(d,                     ; Extract the substring...
        *-1,                   ; ...from 1 character from the end of the string     [0]
        *                      ; ...to the last character                           [2]
       )                                                                            [02]
                                                                                [MAR02]

Commentary
I don't think I've ever seen another Caché answer on this site. I'm only forced to know the language because of work (legacy code), but language itself is very powerful.
Some notes about the language:

Caché doesn't really care about whitespace, so r x r y is the same as r x \n r y
Each function is the shortname for the longer version:

r == read
s == set
$zcvt == $zconvert
$zd == $zdate
$zdth == $zdateh
$e == $extract

Arrays are 1-indexed

Unfortunately, there is no online interpreter for Caché. Probably either because it's too obscure or maybe a licensing thing.
If you're interested in the language, you can check out their docs on their very 90's looking website :)

PHP, 146 Bytes.
Manipulating string
Code Try it online
function f($d){echo strtr(ltrim(substr($d,-2),'0'),array_combine(range(1,12),
str_split(JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC,3))).substr($d,2,-2);}

Explanation
function f($d){
                                #strtr allows u to set an array to replace the ocurrences
echo strtr(ltrim(substr($d,-2),'0'),        #Substring of the last two numbers of the input,
                                           #removing leading zero
    array_combine(range(1,12),
    str_split(JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC,3)))
                                           #create an array of ["1"=>JAN, "2"=>FEB...12=>DEC],
                                           #split the string by 3 characters
    .substr($d,2,-2);
                                           #Concatenate the 2 middle characters
}

JavaScript ES6, 61 bytes
@Downgoat seems not there so I repost to optimize
a=>(new Date(0,a%100-1)+0).slice(4,7).toUpperCase()+a[2]+a[3]

C (tcc), 155 bytes
Longest answer here.
main(i){char*k,s[6],*a="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";gets(s);strcpy(k,s+2);memset(k+2,0,2);i=atoi(s+4)*3;memset(a+i,0,i);strcat(k,a+i-3);puts(k);}

Try it online!

Welcome to PPCG! :)

136 bytes

C (gcc), 107 104 bytes
main(){char s[7];gets(s+1);write(1,memcpy(s,"JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"+~-atoi(s+5)*3,3),5);}

Try it online!

Pyth, 42 bytes
Ac2>Q2+@c12."AY4H~0ë™~³!ò²×Œ¶7Ö"tiHTG

Try it online!
Ac2>Q2+@c12."AY4H~0ë™~³!ò²×Œ¶7Ö"tiHTG   // With Input '123405'

   >Q2                                       // Get input from index 2 (3405)
Ac2 ^                                        // Split it in two and assign to G and H (G='34', H='05'])
           ."AY4H~0ë™~³!ò²×Œ¶7Ö"             // Packed string representing: "JANFEBMAR..."
        c12."    JANFEBMAR...     "        // Chop it into 12 pieces (["JAN", "FEB", "MAR"...])
                                     tiHT    // Convert "05" to 5, subtract 1.
       @  ["JAN", "FEB", "MAR"...]   tiHT    // Get element at that index (MAY)
      +           "MAY"                  G   // "MAY" + 34

Groovy, 69 55 51 bytes
f={sprintf('%Tb',(it[4..5]as int)*22**7L)+it[2..3]}

Try it online!
This formats a millisecond value as an uppercase month name: sprintf('%Tb',value).  The magic value of 22^7 is a value such that n * 22^7 milliseconds after epoch is in the nth month of the year of 1970.  This value was derived by testing all possible 1 to 2 digit values.  Therefore month * 22^7 will yield a value within that month.

1970-01-29
1970-02-27
1970-03-28
1970-04-26
1970-05-25
1970-06-23
1970-07-22
1970-08-19
1970-09-17
1970-10-16
1970-11-14
1970-12-13

Haskell, 85 bytes
f s=3`take`drop(read(drop 4s)*3-3)"JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"++[s!!2,s!!3]

Try it online!

Vyxal o, 37 bytes
4ȯI«×g~Þ¯p-Ḃ:u‹Ẇ¹²Ṗ¨€r;↓§%«3ẇ$‹i⇧₴4Ẏ∷

Try it Online!
4ȯI                # Month as int
   «...«3ẇ         # Compressed string of month names
          $‹i      # Get the correct month
             ⇧₴    # Uppercase and print
               4Ẏ∷ # Get the last two digits of year

Lua 5.3, 82 bytes
i=io.read()print(os.date("%b%y",os.time({year=i//100,month=i%100,day=1})):upper())

Needs to be run on an english machine, as the month name is language specific.
Version that works in any locale 91 bytes
i=io.read()j=i%100*3 print(("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"):sub(j-2,j)..i:sub(3,4))

%100 can be %20

Scala, 85 bytes
s=>"JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".drop(30*s(4)+3*s(5)-1587).take(3)+s(2)+s(3)

The index lookup 30*s(4)+3*s(5)-1587 is a golfed version (via ASCII arithmetics) of the more readable s.slice(4,6).toInt*3-3.
Try it online!
I also tried the nice trick by @cliffroot to represent the names of the months via Chinese characters. This gives the following variant that is 23 characters shorter (62 instead of 85), but at the end 1 byte longer (86 instead of 85):
s=>""+BigInt(""+"憯䷳烣㘿烪摿摽㛨近筍矯䏔"(10*s(4)+s(5)-528),36)+s(2)+s(3)

Factor, 56 bytes
[ 2 tail 2 cut dec> months "%b"strftime >upper prepend ]

Try it online!
Explanation
          ! "201604"
2         ! "201604" 2
tail      ! "1604"
2         ! "1604" 2
cut       ! "16" "04"
dec>      ! "16" 4
months    ! "16" T{ duration f 0 4 0 0 0 0 }
"%b"      ! "16" T{ duration f 0 4 0 0 0 0 } "%b"
strftime  ! "16" "Apr"
>upper    ! "16" "APR"
prepend   ! "APR16"

Python, 115 bytes
m='JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC'.split();d=input();print("%s%s"%(m[int(d[4]+d[5])-1],d[2]+d[3]))

Try it online

I suggest that you look into lambda functions and generally try to avoid use of split() - That said, I think that JQBLZ's manual string parsing answer may already be optimal for Py3 - you should take a look at that one

Thunno 2, 32 bytes
²ẸN“¤ɼḋġŀ§P¡^Ȥḥ)ñt:²æṆµṖƒr“R³İs+

Attempt This Online!
Explanation
²ẸN“...“R³İs+    # Implicit input        ->  "123405"
²                # Split into pairs      ->  ["12","34","05"]
 Ẹ               # Dump onto stack       ->  "12", "34", "05"
  N              # Cast to integer       ->  "12", "34", 5
   “...“         # Compressed string     ->  "12", "34", 5, "janfeb...novdec"
        R        # Uppercase it          ->  "12", "34", 5, "JANFEB...NOVDEC"
         ³       # Split into threes     ->  "12", "34", 5, ["JAN",...,"DEC"]
          İ      # One-based indexing    ->  "12", "34", "MAY"
           s+    # Swap and concatenate  ->  "12", "MAY34"
                 # Implicit output       ->  "MAY34"

Go, 107 bytes
import(."time";."strings")
func f(s string)string{t,_:=Parse("200601",s)
return ToUpper(t.Format("Jan06"))}

Attempt This Online!
I wish Go's time formatting strings allowed all caps months like JAN06; that would save 22 bytes.

Batch, 148 bytes
@set d=%1
@for %%m in (JAN.01 FEB.02 MAR.03 APR.04 MAY.05 JUN.06 JUL.07 AUG.08 SEP.09 OCT.10 NOV.11 DEC.12)do @if %%~xm==.%d:~4% echo %%~nm%d:~2,2%

No date libraries to speak of so manual parsing ftw. I don't know whether the rules of Code Golf allow creating 12 appropriately-named files in the current directory, resulting in something like this:
@set d=%1
@for %%m in (*.%d:~4%)do @echo %%~nm%d:~2,2%

Ruby 46 + 6 for -rdate = 52
For completeness, if nothing else.
->d{Date.strptime(d,'%Y%m').strftime('%^b%y')}

See the tests on repl.it: https://repl.it/Cj7z

The closest I could get without rdate was 70 bytes, so this looks like the winning tactic for Ruby.

-6?

T-SQL, 96 bytes
declare @i varchar(8)
select  @i = '201604'
select upper(left(datename(month,@i+'01'),3)) + substring(@i,5,2)

Java, 142 bytes
s->(new String[]{"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"})[Integer.decode(s.substring(4))-1]+s.substring(2,4);

dc, 103 bytes
[0n]sP[JAN][FEB][MAR][APR][MAY][JUN][JUL][AUG][SEP][OCT][NOV][DEC]Csi[lid1-si:mz1<M]dsMxA0~;mPA0~dZ2>Pp

Try it online!
[0n]sP is a macro that just prints a 0 w/o a newline for the sake of padding 1-9.
[JAN]...[DEC] places the strings on the stack. Csi[lid1-si:mz1<M]dsMx is a macro that decrements i from 12, popping the strings off of the stack and placing them at index i in the array m. Stops when one item (input) is left on the stack.
100~;mP does quotient/remainder division by 100, and prints the value from m indexed by the remainder. The quotient is left on the stack. 100~dZ2>Pp again gets the remainder after dividing by 100, runs the padding macro P this is one digit long, and then prints.
Without any way of manipulating strings, I don't think that part is golfable. Doing any sort of wizardry with JAN/JUN/JUL would likely take far more bytes than the strings themselves.

Tcl, 98 bytes
proc C d {scan $d %2d%2d%2d d y m
format %s%02d [string tou [clock f [clock sc $m/1/0] -f %b]] $y}

Try it online!

Tcl, 115 bytes
proc C d {scan $d %2d%2d%2d d y m
format %s%02d [lindex {. JAN FEV MAR APR MAY JUN JUL AUG SEP OCT NOV DEC} $m] $y}

Try it online!

Tcl, 144 bytes
proc C d {scan $d %2d%2d%2d d y m
format %s%02d [string map {10 OCT 11 NOV 12 DEC 1 JAN 2 FEV 3 MAR 4 APR 5 MAY 6 JUN 7 JUL 8 AUG 9 SEP} $m] $y}

Try it online!

Failed outgolf: https://tio.run/##TY5NC4JAGITv/Yr3oJcg2F2t@7JZIPmBpRC2B1GTwNVlNUjE326rXRoG5pk5TZ/X8yxVmwODAsYuzxowCjBJ8bMeBxCbZ6tE1oPZmUhvaderV1OBypqqBJf6JyfxaETDyKN3N/bd@ELj89UJA3bzg@ToMEjLj1RgiK21s/h/w5yDMUxzLTK5PNgQhA/IBi2NWnjFBTBZERPLRvsVJxjlu@/04wekTAef5i8

Another fail: https://tio.run/##RY5NDoIwEIX3nOItYGloK3oBvEXpAosaI6VNWxaEcPY6/BhfJplvXiZvJuo@JeetRo0Oc9DtgLxDIbq9yJxgsqf1po0oQsHIkyH69/BCtKNzDw@pe6s/OJaOaY8yJS8ZCadfxE39@a4U8mlJvWndej4TjF9ZBRIhiW@4AhcbcnGu2GXDBbMbY6B3G8iamlrSFw

Yet another: https://tio.run/##NY7BCoMwEETv/Yo5mGMxSW1/wOJPpDnYaEupMSGJBxG/PV2VDgvz2IGdTWbI2QdnUKPDEk07oujAZHcMLWfYk4p9QoOXC7ZNGiwyTpmKKXzGN5KbvO8DlBmc@aJo/nScs6UoOQlnSthdH/7UGsW85sG2fqs@SS5uvAKJkCR23EDIHYW8VPy644rFTynSqw@omkyv@Qc

Python, 75 bytes
Here is my obvious Python lambda, takes and returns a string, hope I didn't miss some obvious hole:
lambda x:"JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"[3*int(x[4:])-3:][:3]+x[2:4]

PHP, 55 bytes
<?=date(My,strtotime(wordwrap($argn,4,"-",1)))&"___??";

Run as pipe with -n or try it online. Requires PHP 5 or later.

Base R, 78 bytes
paste(casefold(month.abb,upper=T)[strtoi(substr(A,5,6))],substr(A,3,4),sep="")

Not sure if this is required to be formatted as a standalone function, but if so, it is 91 bytes:
function(A){paste(casefold(month.abb,upper=T)[strtoi(substr(A,5,6))],substr(A,3,4),sep="")}

You will need to use the function, your first piece of code is called a snippet, and they are disallowed.  I don't know much about R but you can also use a complete program or anonymous function if that helps.

Thanks for the clarification. I'm new to this game. Is there a general documentation for the rules of the game?

Yes there is.  Note that these are just defaults so they can be overridden by individual challenges, however they rarely are.

Python, 72 Bytes
lambda x:'JFMAMJJASONDAEAPAUUUECOENBRRYNLGPTVC'[int(x[4:])-1::12]+x[2:4]

Try it online!
Uses a stepping approach.

See jqkul's answer for -1 byte.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Play scrabble with the periodic table
You've got a set of tiles with the symbols from the periodic table. Each symbol appears once. You're thinking up words to make but you want to know if it's possible or not.
The Challenge
Write a program in your favourite language that will take in a string as an input parameter. You may assume that input is not null, has no spaces and consists of ASCII characters.
Your program should take that string and output a truthy value if that word can made up of symbols from the periodic table of elements, and a falsey value if the word cannot.
To make this challenge more difficult, you may not use a symbol twice. So if you use Nitrogen N you may not use N again in the same word.
Rules
Standard loopholes are not allowed. You may use symbols from elements 1-118 (Hydrogen to Ununoctium). You can find a list of all the elements here. You may read the list of symbols in from a file or input arguments if you wish.
Test Cases:
Laos - true (LaOs)
Amputation - true (AmPuTaTiON)
Heinous - true (HeINoUS)
Hypothalamus - true (HYPoThAlAmUS)
Singapore - true (SiNGaPoRe)
Brainfuck - true (BRaInFUCK)
Candycane - false

This is a code golf challenge, shortest code wins.
BEFORE YOU CLOSE AS DUPLICATE: While this may seem similar to this challenge, I feel it is different because it is not 'Generate a list of all words that are possible from the periodic table', it is 'Take in arbitrary input and determine if it can be made from the periodic table'

I like this one, I look at it later

There's this which is more closely related but was itself closed as a duplicate of the challenge you linked. I think the fact you can only use a symbol once is the greatest differentiation between the challenges though. In terms of golfing I doubt there's a better way than brute forcing all possible words and checking if the input is among them.

A question though, what elements should we use? Do Uus, Uuo, etc. count?

@Bálint The challenge says 1-118.

"You may read the list of symbols in from a file if you wish." - how do we count it? Is size of the file added to the code length? Or we can use it for free?

Can we take the list of elements as an argument to the program?

@Qwertiy, the size of the file is free, but the bytes to read it in are not.

Boron, Radium, Iodine, Nitrogen, Fluorine, Uranium, Carbon, Potassium.

@Neil gets votes just by saying a few elements.

What about the case of the word/symbols?

@Neil Swap the Iodine and Nitrogen for Indium.

@SuperJedi224 I should have made my answer output all the solutions instead of working out manually why it returned true.

Why did you allow to read in the element's names as a file? I find it much more challenging (and therefore interesting) to encode them in the source code itself.

I'll just leave this here in case anyone else thought this would be a fun board game XD

05AB1E, 16 bytes
œvyŒ€J})˜Ùvy²Q}O

Explained
œv                # for each permutation of the list of elements
  yŒ              # get all sublist of elements
    €J            # join as strings to form the words possible to spell
      })˜Ù        # convert to list of unique spellable strings
          vy²Q}   # compare each word with input word
               O  # sum giving 1 if the word is found, else 0

Warning: Extremely slow. I recommend testing on a much smaller subset of elements in the online interpreter.
Takes list of elements as first argument.
Takes word to test as second argument.
Returns 1 for true and 0 for false.
Try it online on a small subset of elements

Brachylog, 7 bytes
spc~@l.

Call with the list of symbols (all lowercase) as Input, and the word as Output, e.g. run_from_atom('spc~@l.', ["he":"n":"o":"li"], "Nohe"). .
Warning: this is extremely inefficent when all symbols are in the list.
Explanation
spc        Create a string from a permutation of a subset of the Input
   ~@l.    This string can unify with the lowercase version of the Output

@Downvoter care to explain?

JavaScript (Firefox 48 or earlier), 103 bytes
f=(w,e=`
H
He
... (list of elements not included in the byte count) ...
Uus
Uuo
`)=>!w||e.match(/\w+/g).some(s=>!w.search(s,`i`)&&f(w.slice(s.length),e.replace(`
${s}
`,`
`)))

Pyth - 13 bytes
Just checks if any partition of lowercased input has all parts in the periodic table.
sm.A}RQd./rzZ

On mobile, so couldn't set up an actual test suite, but try this.

You wrote this on a phone!?

This doesn't ensure an element is not used multiple times. Example.

Pyth, 11 bytes
s}RySQSM./z

Try it online. Test suite.
Written on my phone, but should work. Very slow for a large number of elements or a long string.
Explanation

Take all partitions (./) of the input (z).
Sort (S) each partition (M).
For each partition (R), see if it is in (}) the list of all subsets (y) of the sorted (S) periodic table given as input (Q).
Sum (s) the resulting list of booleans.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Character Counting System
GOAL :
 To Implement a character counting program
This is how this counting system works :
input of the program is a set of printable ASCII characters . the program counts each type of character , and outputs the number of each character , starting from first mentioned character to last mentioned character .
Example :
input : aaaabbbbbcccc    123445b
output : 4 6 4 4 1 1 1 2 1

Which 4 is number of as , 6 is number of bs , 4 is number of cs , 4 is number of spaces () and so on . Also you can split answers with space (like example) , EOL , or anything other than numerals .
Rules
Your program must log to STDOUT or an acceptable alternative, if STDOUT is not available.
Your program must be a full, runnable program, and not a function or snippet
It's optional to mention the ungolfed version of program and/or a short explanation  .
Test input : ThIs Is ThE iNPUT , WITH 72/2 CHARS!
Test output : 4 2 3 2 7 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1

What is the reason for disallowing functions? Does not make much sense for this challenge and gives a significant disadavante to languages like Java.

For reference, the default allows programs and functions but disallows snippets and also allows a few alternative output methods. This is a nice first challenge, but nevertheless I'd recommend posting future challenge ideas in the sandbox so you can get feedback before posting them. :)

Spaces, newlines, tabs, carriage returns, nonbreaking spaces and vertical tabs are not printable ASCII, yet your example contains and counts spaces. Do we count all the bytes of the input or not?

Can there be a trailing space?

@cat Spaces are printable ASCII.

MATL, 3 bytes
8#u

Input is a string enclosed with quotation marks (which is allowed by default)
Try it online!
Explanation
u is the unique function, which essentially removes duplicates. It can produce up to four outputs. The fourth output is the count of unique characters, identified in order of appearance.
8# specifies that the fourth output of u should be produced. In general, 2# means "produce two outputs", 3# means "produce three outputs" etc. When the maximum number of function outputs is reached, larger numbers mean "take the first output only", or "the second only" etc. Thus, since u has four possible outputs, 4# would produce all four outputs; 5# produces the first, 6# the second, etc.

well , it doesn't work with ' at first and end , which is not allowed , can you edit it in a way that it doesn't need ' ? or is this an implemented feathure in the language ?

I'm not sure what you mean. About strings using quotes, see here

Ok , i didn't know that

05AB1E, 6 bytes
Ùv¹y¢,

Explained
Ùv      # for each unique char in original order
  ¹y¢   # count number of occurances in input string
     ,  # print on newline

Try it online

you have forgot to delete """ (quation marks) in try it online , which produced extra 2 at the first of output

@GLASSIC: Yeah, I just noticed. Thanks!

Pyth, 4 bytes
/LQ{

Test suite.
Explanation
/LQ{    Input: Q
/LQ{Q   Implicitly fill arguments

   {Q   Yield the unique elements of Q.
 L      For each unique element:
/       Yield its number of occurrences
  Q     in Q.

J, 18 15 bytes
echo#/.~stdin''

Following the challenge spec to write a program, the above is a one-line script in J that reads a line from stdin, computes the result, and prints it to stdout.
If using an online interpreter, it would require 4 bytes since without stdio, only function arguments could be used.
#/.~

Straight-forward application of adverbs /. and ~ to the tally # verb.
Usage
As a script,
$ echo -n 'aaaabbbbbcccc    123445b' | jconsole golf.j
4 6 4 4 1 1 1 2 1

As a function,
   (#/.~) 'aaaabbbbbcccc    123445b'
4 6 4 4 1 1 1 2 1

Explanation
#/.~  Input: s
   ~  Reflects the input
 /.   An adverb that executes a verb on each set of identical items in s
      Operates in the order of first-seen distinct items in s
#     Get the size of each set of identical items
      Returns a list of the sizes of identical items

CJam, 9 bytes
l__&\fe=p

Test it here.
Explanation
l    e# Read input.
__   e# Make two copies.
&    e# Set intersection - removes duplicates.
\    e# Swap with input.
fe=  e# For each (unique) character, count its occurrences.
p    e# Print as array literal.

Dyalog APL, 10 bytes
Shortest by byte count
+⌿t∘.=∪t←⍞

t←⍞ get character input and store as t
`∪' unique elements of
t∘.= table of which elements of t are equal to (the unique elements of t)
+⌿ sum the columns
5 character solution which unfortunately is 15 bytes:
⊢∘≢⌸⍞

⍞ get character input
⌸ make a table of contents containing...
⊢∘≢ the tally (≢) of the indices while the entries are ignored (⊢)

Jelly, 4 bytes
Qċ@€

Try it online
Explanation
Qċ@€   Main link. Argument: S

Q      Remove duplicate characters from S.
       Current value v contains each character of S once sorted by first appearance.
  @€   For each character in v.
 ċ       count its occurrence in S.

Mathematica, 56 bytes
Print@StringRiffle[Last/@Tally@Characters@InputString[]]

Essentially, Tally does exactly what the challenge asks for (although it gives pairs of {element, count}). The rest is just for working with strings and proper I/O for a full program.

Retina, 30 28 bytes
2 bytes thanks to Martin Ender.
+`((.).+)\2
$2$1
(.)\1*
$.&¶

Try it online!

Brachylog, 32 bytes
:efd:?:{tL,?he:L:{t:.m~h?}fl.}f.

Awfully long but there's no simple way of counting elements of something yet…

Java 7, 246 235 231 213 bytes
Loads of bytes removed thanks to cliffroot.
import java.util.*;class M{public static void main(String[]a){Map<Long,Long>m=new LinkedHashMap();for(long c:a[0].toCharArray())m.put(c,m.get(c)!=null?m.get(c)+1:1);for(Long e:m.values())System.out.print(e+" ");}}

Ungolfed & test code:
Try it here.
import java.util.*;

class Main{
  public static void main(String[] a){
    // Test code:
    a = new String[]{ "ThIs Is ThE iNPUT , WITH 72/2 CHARS!" };

    Map<Long, Long> m = new LinkedHashMap();
    for(long c : a[0].toCharArray()){
      m.put(c, m.get(c) != null ? m.get(c) + 1 : 1);
    }
    for(Long e : m.values()){
      System.out.print(e + " ");
    }
  }
}

Output:
4 2 3 2 7 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1

You can use
Map m=new LinkedHashMap which saves some bytes.
Also in your first loop you can use int instead of char

@cliffroot Ah of course, edited. Thanks!

Map<Long,Long>m=new LinkedHashMap<>(); saves 2 more bytes because it allows to remove cast to int (though you'll have to use long in the first cycle) and to use Map.Entry in your second for-each loop.

The last for loop is basically just for(Long e:m.values())System.out.print(e+" ");

Python 3, 134 81 bytes
s,r=input(),[]
for c in s:
 k,s=s.count(c),s.replace(c,'')
 if k:r+=[k]
print(*r)

Output:
4 2 3 2 7 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1

Not that short :(

Another approach: 109 bytes
Not shorter than the others but the counting happens in a one-liner.
s=input()
k=[i[1]for i in sorted({i:str(s.count(i))for i in s}.items(),key=lambda v:s.index(v[0]))]
print(*k)

Edit: Golfed 53 bytes thanks to @Dr Green Eggs and Iron Man
Edit 2: Added one-liner method

You could make this a lot shorter by deleting the first and last lines, and putting s=input();r=[]

Java 7, 172 168 bytes
class M{public static void main(String[]a){int[]m=new int[256];byte[]b=a[0].getBytes();for(int z:b)m[z]++;for(int z:b){System.out.print(m[z]>0?(m[z]+" "):"");m[z]=0;}}}

Stores number of occurrences in an int array, then for each char print number of occurrences and replace this value with zero so it won't be printed again.
Whitespaces and comments added:
class M{
    public static void main(String[]a){
        int[]m=new int[256]; // map, ascii value to number of occurrences
        byte[b]=a[0].getBytes();
        for(int z:b)m[z]++; // count number of occurrences
        for(int z:b){
            System.out.print(m[z]>0?(m[z]+" "):""); // print result
            m[z]=0; // make it not be printed again
        }
    }
}

See it online: https://ideone.com/7X58F9

+1 and since you've helped me out in my Java 7 answer I'll help you as well. :) You can add byte[]b=a[0].getBytes(); and replace both a[0].getBytes() with b to save 4 bytes.

@Kevin Cruijssen oh right, thank you.
We can arguably do byte[]m=new byte[256],b=a[0].getBytes();, but then number of symbols occurrences will be limited to 256

C#
public static void Main(string[] args)
    {
        string str = "aaaabbbbbcccc    123445b";
        Dictionary<char, int> counts = new Dictionary<char, int>();

        for (int i = 0; i < str.Length; i++)
           if (counts.ContainsKey(str[i]))
               counts[str[i]]++;
           else
              counts.Add(str[i], 1);

        foreach (var count in counts)
         Console.WriteLine("{0} = {1}", count.Key, count.Value.ToString());
    }

Hi, and welcome to the site! This is a [tag:code-golf] challenge, meaning all answers must at least make an attempt to shorten their code as much as possible. For example, you can remove your whitespace, and use one letter variable names. You can also look through our list of tips for golfing in C#. If you don't try to shorten this code, the answer is invalid, and it will probably need to be deleted.

ES6, 90 bytes

a=prompt();b=new Map();for(c of a)b.set(c,(b.get(c)|0)+1);alert([...b.values()].join(' '))

Python 3, 76 73 bytes
3 bytes shorter:
s,a=input(),[]
for y in s:a+=(y,'')[y in a]
print([s.count(x)for x in a])

Old version:
s=input();print([s.count(x)for x in sorted(set(s),key=lambda i:s.index(i))])

Iterates over a sorted set of unique characters from the input, counts the occurrences, and outputs a list of the counts.

@LeakyNun That returns the generator object for me.

I don't understand. Doesn't sorted(s) have the same number of elements?

sorted(s) has the same number of elements as the input, but I'm sorting a set of the input that has only unique elements (using the indexes of the original as the key, to preserve the order).

Does set preserve input order?

No, it's unordered. https://docs.python.org/3/tutorial/datastructures.html#sets A set is an unordered collection with no duplicate elements.

@Dopapp not for Python 3.

@atlasologist oh. Good to know!

Python 2.7 - 103 Bytes (Ungolfed)
i=list(raw_input())
print ''.join([str(e) for e in map(lambda x,y:x!=y and i.count(x)or' ',i,['']+i) ])

edit: Thanks to Dr Green Eggs and Iron Man for helping to reduce 47 Bytes!

You can shorten it by 36 bytes by changing the first three lines to i=input() I don't think stripping whitespace or printing the original string is necessary.

You could also just do print s on the last line. (Although I haven't tested that)  you might need print list(s) or print[s]

Python 3, 93 bytes
s=input();c,o=[],""
for i in s:
 if i not in c:c+=i
for i in c:o+=str(s.count(i))+" "
print o

Matlab, 47 chars
@(y)arrayfun(@(x)sum(y==x),unique(y,'stable'))

Reasonably straightforward, though the default behavior of Matlab's unique function to sort the values makes the function rather longer.

Pyke, 3 bytes
}F/

Try it here!
for i in uniquify(input): print input.count(i)


text:
Bytes/Character
Task
Given a UTF-8 string (by any means) answer (by any means) an equivalent list where every element is the number of bytes used to encode the corresponding input character.
Examples
! → 1
Ciao → 1 1 1 1
tʃaʊ → 1 2 1 2
Adám → 1 1 2 1
ĉaŭ → 2 1 2 (single characters)
ĉaŭ → 1 2 1 1 2 (uses combining overlays)
チャオ → 3 3 3
 (empty input) →  (empty output)
!±≡ → 1 2 3 4
 (a null byte) → 1
Null bytes
If the only way to keep reading input beyond null bytes is by knowing the total byte count, you may get the byte count by any means (even user input).
If your language cannot handle null bytes at all, you may assume the input does not contain nulls.

If the input is empty can we output 0 or another falsey value?

@AlexA. No, that would prevent stringing together multiple results, and I already gave the spec for empty input.

That's fine but I don't get what you mean regarding stringing together results.

@AlexA. Let's say we are receiving and counting multiple inputs, and each input gets run through the byte counter. The byte counts are appended to a result file. A non-empty answer to empty input would cause input and result file to get out of sync length-wise.

Can I print the byte counts without separation? The highest possible value is 6, so it's unambiguous.

@Dennis Yes, that's fine.

You know what's amazing? Copying the two ĉaŭ test cases out of this question works and preserves the combining characters on the second one, even though they produce identical glyphs.

@Adám I wish that had been added to the question in the first place, that will quite shorten some implementations

@cat What had been added?

Do we have to support null bytes? Those can be a real pain in some languages...

@Dennis Yes, but feel free to include the shorter version that doesn't.

You should add that to the post. I don't know most of the languages well enough to tell if it makes a difference, but I think it invalidates at least two of the answers.

@Dennis I tried, but feel free to edit if you can make it better.

My language doesn't see a difference between a NUL byte and the end of a string. Can I request that the length of the string be given as a parameter?

@cat That won't help you know where the null bytes are. See edit.

@Adám yes it will. In C, for example, C strings end with a NUL byte, so you stop reading as soon as you find one. If you know the length of the string, you stop reading after that many bytes, NUL and all.

@cat Ah, ok, I'll add that you can get the byte count if so.

How strict are you on the output?  Can the byte values be separated by newlines or do they have to be spaces?

@JAL OP: by any means. Dennis: Can I print the byte counts without separation? The highest possible value is 6, so it's unambiguous. Adám: Yes, that's fine.

Pyth, 9 7 bytes
Thanks to @Maltysen for saving 2 bytes!
mlc.Bd8

Test suite
Converts every character of the input to it's binary representation and then splits this into chunks of length 8. The number of those chunks is then the amount of bytes needed to encode that character.

you can save 2 bytes with splitting instead of dividing and then removing the .E http://pyth.herokuapp.com/?code=mlc.Bd8&input=%22t%CA%83a%CA%8A%22&test_suite=1&test_suite_input=%22%21%22%0A%22Ciao%22%0A%22t%CA%83a%CA%8A%22%0A%22Ad%C3%A1m%22%0A%22%C4%89a%C5%AD%22%0A%22%E3%83%81%E3%83%A3%E3%82%AA%22%0A%22%22%0A%22%21%C2%B1%E2%89%A1%F0%A9%B8%BD%22&debug=0

@Maltysen That's clever, thanks!

Same length answer that relies on a similar trick: mlhc8.B

@LeakyNun then it would be simple thing to give a test case that fails, wouldn't it?

To save another byte, instead of splitting into chunks of 8, take every 8th: ml%8.B (now the d is implicit).

Python 3, 42 36 bytes
lambda x:[len(i.encode())for i in x]

-1 byte: use map. lambda x:map(len,map(str.encode,x))

@NoOneIsHere: That only works on Python 2, not Python 3; on Python 3, map produces a lazy iterator, not a list, so the return value would not show the lengths of anything. You'd need lambda x:[*map(len,map(str.encode,x))] or lambda x:[len(c)for c in map(str.encode,x)] to use map, and both of those would be longer than the listcomp in the answer.

@ShadowRanger I'm surprised I'm still here 7 years later but you are right, I should have mentioned -1 byte in Python 2

APL, 15 chars
≢¨'UTF-8'∘⎕ucs¨

In English: convert each character to UTF-8 (meaning: vector of bytes representation) and get its tally.

Save a byte: ≢¨'UTF-8'∘⎕ucs¨

Indeed @Adám... Cheers.

An interesting (but longer) array based approach: +⌿0 7 11 16∘.≤2⍟⎕UCS

Version 16.0: 0 7 11 16⍸2⍟⎕UCS

C, 68 65 bytes
b;main(c){for(;~c;b=c/64^2?b?putchar(b+48)/48:1:b+1)c=getchar();}

Thanks to @FryAmTheEggman for golfing off 3 bytes!
Test it on Ideone.

GolfScript, 16 bytes
{64/2=}%1,/{,)}*

Try it online!
Background
GolfScript doesn't have a clue what Unicode is; all strings (input, output, internal) are composed of bytes. While that can be pretty annoying, it's perfect for this challenge.
UTF-8 encodes ASCII and non-ASCII characters differently:

All code points below 128 are encoded as 0xxxxxxx.
All other code points are encoded as 11xxxxxx 10xxxxxx ... 10xxxxxx.

This means that the encoding of each Unicode character contains either a single 0xxxxxxx byte or a single 11xxxxxx byte and 1 to 5 10xxxxxx bytes.
By dividing all bytes of the input by 64, we turn 0xxxxxxx into 0 or 1, 11xxxxxx into 3, and 10xxxxxx into 2.
If we compare the quotient with 2 – pushing 1 for 2; and 0 for 0, 1, and 3 – each character will be turned into a 0, followed by 1 to 5 1's.
All that's left is to split the resulting string at occurrences of 0, count the number of 1's between those zeroes and add one to the amount.
How it works
{     }%          Map the following over all bytes in the input.
 64/                Divide the byte by 64.
    2=              Compare the quotient with 2, pushing 1 or 0.
        1,        Push range(1), i.e., [0].
          /       Split the array of Booleans around zeroes.
           {  }*  Fold; for each run of ones but the first:
            ,       Push its length.
             )      Increment.

JavaScript (ES6), 54 45 43 bytes
s=>[...s].map(c=>encodeURI(c).length/3-8&7)

Edit: Saved 2 bytes with help from @l4m2.

s=>[...s].map(c=>encodeURI(c).length/3-4&3)

@l4m2 That fails for non-BMP characters but I was able to fix it up.

PowerShell v4, 58 bytes
[char[]]$args[0]|%{[Text.Encoding]::UTF8.GetByteCount($_)}

NB
OK, this should work, and does in almost all of the test cases except for  which is somehow counted as 3,3 on my machine. That character even shows as 7 bytes on my computer. I suspect this is due to some sort of bug in the Windows or .NET version that I'm running locally, as @Mego doesn't have that issue. (Edit: @cat points out this is due to BOM. Thanks for solving that mystery, @cat!)
However, that still doesn't account for all of the problem. I think I know where some of the problems are coming from, though. Inside .NET, all strings are composed of UTF-16 code units (which is the System.Char type). With the very loose typecasting that PowerShell uses, there's a lot of implicit casting and conversion between types in the background. Likely this is a contributing factor to the behavior we're seeing -- for example, [system.text.encoding]::utf8.getchars([System.Text.UTF8Encoding]::UTF8.GetBytes('')) returns two unprintables, rather than a single character.

Explanation
Very straightforward code. Takes the input $args[0] and explicitly casts it as a char-array so we can loop through each component of the string |%{...}. Each iteration, we use the .NET call [System.Text.Encoding]::UTF8.GetByteCount() (the System. is implied) to get the byte count of the current character $_. That's placed on the pipeline for later output. Since it's a collection of [int]s that are returned, casting to an array is implicit.
Test Runs
PS C:\Tools\Scripts\golfing> .\bytes-per-character.ps1 'tʃaʊ'
1
2
1
2

PS C:\Tools\Scripts\golfing> .\bytes-per-character.ps1 'Adám'
1
1
2
1

PS C:\Tools\Scripts\golfing> .\bytes-per-character.ps1 'ĉaŭ'
2
1
2

PS C:\Tools\Scripts\golfing> .\bytes-per-character.ps1 'ĉaŭ'
1
2
1
1
2

PS C:\Tools\Scripts\golfing> .\bytes-per-character.ps1 'チャオ'
3
3
3

PS C:\Tools\Scripts\golfing> .\bytes-per-character.ps1 '!±≡'
1
2
3
3
3

Edited to add This does properly account for the null-bytes requirement that was added to the challenge after I originally posted, provided you pull the data from a text file and pipe it as follows:
PS C:\Tools\Scripts\golfing> gc .\z.txt -Encoding UTF8|%{.\bytes-per-character.ps1 $_}
2
1
1
1

That character even shows as 7 bytes on my computer. Yes, that's because of Byte-Order Mark which is what you get on Windows with UTF-8. Tell Notepad++ to use UTF-8 without BOM (as you should always avoid the BOM, especially for compatiblity with Unicies) and you will find the file has a size of 4 bytes, because the BOM is 3 and 4 + 3 = 7

@cat Ah, yes, that makes sense. OK, so that accounts for the difference in file sizes. However, that still doesn't account for the differing behavior inside the shell itself. For example, saving it as UTF-8 without BOM, and running get-content -Encoding UTF8 .\z.txt|%{.\bytes-per-character.ps1 $_} still returns 3,3.

The -Encoding parameter does not appear to be supported.

But apparently it still works fine anyway

Java 10, 100 96 95 67 61 bytes
a->{for(var c:a)System.out.print(c.getBytes("utf8").length);}

-4 bytes removing spaces because this is allowed in the comments
-1 byte changing UTF-8 to utf8
-28 bytes going from Java 7 to 8 (a->{...} instead of void c(char[]i)throws Exception{...})
-3 bytes taking the input as String-array instead of character-array, and
-3 bytes going from Java 8 to 10 (var instead of String)
Explanation:
Try it online.
a->{                      // Method with String-array parameter and no return-type
  for(var c:a)            //  Loop over the input-array
    System.out.print(     //   Print:
      c.getBytes("utf8")  //    The bytes as array in UTF-8 of the current item,
       .length);}         //    and print the amount of bytes in this array

Does it work for null bytes?

@cat The test case for null-bytes was later added. But yes, it does also work for null-bytes and I've added the test case.

Perl 6,  77 69  63 bytes

put +$0 if $_».base(2).fmt("%8d")~~/^(1)**2..*|^(" ")/ while $_=$*IN.read: 1

put +$0 if $_».fmt("%8b")~~/^(1)**2..*|^(" ")/ while $_=$*IN.read: 1

put 1+$0 if $_».fmt("%8b")~~/^1(1)+|^" "/while $_=$*IN.read: 1

put 1+$0 if $_».fmt("%0.8b")~~/^1(1)+|^0/while $_=$*IN.read: 1

Since Perl 6 uses NFG strings I have to pull in the bytes directly, which sidesteps the feature.
(NFG is like NFC except it also creates synthetic composed codepoints)
The output is separated by newlines.
Test:
for text in '!' 'Ciao' 'tʃaʊ' 'Adám' 'ĉaŭ' 'ĉaŭ' 'チャオ' '' '!±≡' '\0';
do
  echo -en $text |
  perl6 -e 'put 1+$0 if $_».fmt("%8b")~~/^1(1)+|^" "/while $_=$*IN.read: 1' |

  # combine all of the lines into a single one for display purposes
  env text=$text perl6 -e 'put qq["%*ENV<text>"], "\t\t", lines.gist'
done

"!"     (1)
"tʃaʊ"      (1 2 1 2)
"Adám"      (1 1 2 1)
"ĉaŭ"       (2 1 2)
"ĉaŭ"     (1 2 1 1 2)
"チャオ"       (3 3 3)
""      ()
"!±≡"     (1 2 3 4)
"\0"        (4 1 4)

Explanation:
# turns the list in ｢$0｣ into a count, and adds one
# ｢put｣ prints that with a trailing newline
put 1+$0

   # if the following is true
   if

       # format the input byte to base 2 and pad it out to 8 characters
       $_».fmt("%8b")

       ~~ # smart match against

       # check to see if it starts with more than one 1s, or a space
       # ( also sets ｢$0｣ to a list that is 1 shorter
       # than the number of bytes in this codepoint )
       / ^1 (1)+ | ^" " /

           # for every byte in STDIN
           while
               $_ = $*IN.read: 1

This works because the first byte in a multi-byte codepoint has the number of bytes encoded inside of it, and the other bytes in the codepoint have the highest bit set, but not the next highest. While the single byte codepoints don't have the highest bit set.

Can't do read:1 and/or /while$ instead? And if that works, if$?

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ No because that would be parsed as something different. I can remove the space before while though.

Can you explain the NFG countermeasures?

If I echo a NUL byte to this program's STDIN, it prints \n1\n1\n, is that intentional? Basically, does this handle NUL bytes?

@cat Why wouldn't it? When I do this: perl -e 'print "\0"' | perl6 -e '...' I get 4␤1␤4 just like I would expect. ( The part about nuls was added after I posted though )

Ok, I just wasn't sure if I was doing something wrong, cheers

@JDługosz The only countermeasure is to not use strings (Str class), and use buffers (Buf class) instead. (read returns a Buf[uint8])

I thought it was something about the difference between the two unstriked variations.  You mean calling read rather than just letting $_ just appear on its own?

@JDługosz I mean calling $*IN.read instead of get $*IN.get $*IN.comb lines $*IN.lines slurp $*IN.slurp-rest $*IN.readchars or something else which returns a Str rather than a Buf[uint8]

Ruby, 33 bytes
Barely edges out Python, yay! Try it online.
->s{s.chars.map{|c|c.bytes.size}}

Python 3, 82 bytes
import math
lambda x:[ord(i)<128and 1or int((math.log2(ord(i))-1)//5+1)for i in x]

This is much longer than the other Python answer, and the majority of the other answers, but uses an approach involving logarithms that I haven't yet seen.
An anonymous function that takes input, via argument, as a string and returns a list.
Try it on Ideone
How it works
This method relies on the way in which UTF-8 encodes the code-point of a character. If the code-point is less than 128, the character is encoded as in ASCII:
0xxxxxxx

where x represents the bits of the code point. However, for code-points greater than or equal to 128, the first byte is padded with the same number of 1 s as the total number of bytes, and subsequent bytes begin 10. The bits of the code-point are then entered to give the shortest possible multibyte sequence, and any remaining bits become 0.
No. of bytes  Format
1             0xxxxxxx
2             110xxxxx 10xxxxxx
3             1110xxxx 10xxxxxx 10xxxxxx
4             11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
...           ...

and so forth.
It can now be noticed that for each number of bytes n, the upper limit for the number of code-point bits is given by (-n+7)+6(n-1) = 5n+1. Hence, the upper limit code-point c for each n is given, in decimal, by  c= 2^(5n+1). Rearranging this gives n = (log2(c)-1)/5. So for any code-point, the number of bytes can be found by evaluating the above expression, and then taking the ceiling.
However, this does not work for code points in the range 64 <= c <= 127, since the lack of a padding 1 due to the ASCII-like encoding for 1 byte characters means that the wrong upper limit is predicted, and log2 is undefined for c = 0, which happens if a null byte is present in the input. Therefore, if c <= 127, a value of 1 is returned for n.
This is exactly what the code is doing; for each character i in the string x, the code-point is found using the ord function, and the ceiling of the expression is found by using integer rather than float division by 5 and then adding 1. Since Python's float type always represents integers as x.0, even after integer division, the result is passed to the int function to remove the trailing zero. If ord(i) <= 127, logical short-circuiting means that 1 is instead returned. The number of bytes for each character is stored as an element in a list, and this list is returned.

Julia, 34 bytes
s->s>""?map(sizeof,split(s,"")):[]

This is an anonymous function that accepts a string and returns an integer array. To call it, assign it to a variable.
The approach is quite straightforward: If the input is empty, the output is empty. Otherwise we map the sizeof function, which counts the number of bytes in a string, to each one-character substring.
Try it online! (includes all test cases)

s->[sizeof("$c")for c=s] saves a few bytes.

Odd; does split("","") not return []? (JavaScript's "".split("") does.)

@Neil split("","") appears to give "" (unlike in Python which gives an exception) but I don't know anything about the compatibility of [] and "" in julia.

@Neil No, split("", "") == [""], i.e. a one-element array containing an empty string, but the issue is that sizeof("") == 0, which the OP said is not allowed.

@Dennis That will fail for non-indexable strings. (Can't think of an example offhand though.)

Is that really a problem? for c=s doesn't iterate over indices, but over characters.

JavaScript (Node), 27 bytes
s=>s.map(Buffer.byteLength)

This takes input as an array of individual characters, and returns an array of byte counts.
Buffer is a method of representing raw binary data. Buffer.byteLength(string) gives the number of bytes in the string. UTF-8 is the default encoding. Note that only Node.js has buffers, not browser JS. The rough browser equivalent is called Blob, which comes in at 31 bytes:
s=>s.map(e=>new Blob([e]).size)

Test
Save this file and run it through node, or try it online.
var f =
  s=>s.map(Buffer.byteLength)

var tests = [
  ["!"],
  ["C","i","a","o"],
  ["t","ʃ","a","ʊ"],
  ["A","d","á","m"],
  ["ĉ","a","ŭ"],
  ["c","̂","a","u","̆"],
  ["チ","ャ","オ"],
  [],
  ["!","±","≡",""]
];

tests.forEach(test => {
  console.log(test, f(test));
});

This should be the result:
$ node bytes.js
[ '!' ] [ 1 ]
[ 'C', 'i', 'a', 'o' ] [ 1, 1, 1, 1 ]
[ 't', 'ʃ', 'a', 'ʊ' ] [ 1, 2, 1, 2 ]
[ 'A', 'd', 'á', 'm' ] [ 1, 1, 2, 1 ]
[ 'ĉ', 'a', 'ŭ' ] [ 2, 1, 2 ]
[ 'c', '̂', 'a', 'u', '̆' ] [ 1, 2, 1, 1, 2 ]
[ 'チ', 'ャ', 'オ' ] [ 3, 3, 3 ]
[] []
[ '!', '±', '≡', '�' ] [ 1, 2, 3, 4 ]

PHP, 92 57 bytes
On second thought you can do this with much less faffing around:
<?php for(;$a=strlen(mb_substr($argv[1],$i++,1));)echo$a;

Try it online note that this is slightly longer as it uses stdin rather than a program argument.
This version requires you to ignore notices sent to stderr but that's fine.
old version:
Uses a rather different approach to the other php answer.
Relies on the lack of native support for multi-byte strings in php.
<?php for($l=strlen($a=$argv[1]);$a=mb_substr($a,1);$l=$v)echo$l-($v=strlen($a));echo$l?:'';

Nice answer! I think you can drop the opening tag entirely, or change it to <?=

Without the tag it's a code snippet rather than a program, and even if that's allowed it makes me feel vaguely dirty. With the alternate tag you get a parse error (or at least I did on php 5.5 which is what I'm used to).

Okay :) I don't know PHP (nor do I want to, cough) but I'll point you here: https://codegolf.stackexchange.com/questions/2913

Emacs Lisp, 55 49 bytes
(lambda(s)(mapcar'string-bytes(mapcar'string s)))

First dissects the string into a list of characters with (mapcar 'string s). The string function in Emacs Lisp takes a list of characters and builds a string out of them. Due to the way Emacs splits strings with mapcar (i.e. into a list of integers, not characters or strings), this explicit conversion is needed. Then maps the string-bytes function onto that list of strings.
Example:
(mapcar 'string "abc") ; => ("a" "b" "c")
(mapcar 'string-bytes '("a" "b" "c")) ; => (1 1 1)

Testcases:
(mapcar
 (lambda(s)(mapcar'string-bytes(mapcar'string s)))
 '("!""Ciao""tʃaʊ""Adám""ĉaŭ""ĉaŭ""チャオ""""!±≡""\0"))
;; ((1) (1 1 1 1) (1 2 1 2) (1 1 2 1) (2 1 2) (1 2 1 1 2) (3 3 3) nil (1 2 3 4) (1))

Old answer:
(lambda(s)(mapcar(lambda(s)(string-bytes(string s)))s))

Ungolfed:
 (lambda (s)
   (mapcar
    ;; we can't use string-bytes directly,
    ;; since Emacs mapcar yields a list of ints instead of characters
    ;; therefore we need a wrapper function here.
    (lambda (s)
      (string-bytes (string s)))
    s))

Testcases:
(mapcar
 (lambda(s)(mapcar(lambda(s)(string-bytes(string s)))s))
 '("!""Ciao""tʃaʊ""Adám""ĉaŭ""ĉaŭ""チャオ""""!±≡""\0"))
;; ((1) (1 1 1 1) (1 2 1 2) (1 1 2 1) (2 1 2) (1 2 1 1 2) (3 3 3) nil (1 2 3 4) (1))

What happens to the nil if you flattens the result?

@Adám nil is an empty list (and the only way to say "false" in Emacs). While there is no standard flatten in Emacs (you can use dash's -flatten) any possible implementation would eliminate it.

Bash, 74 bytes
Golfed
xxd -p|fold -2|cut -c1|tr -d '89ab'|echo `tr -t '01234567cbef' '[1*]2234'`

Algorithm
hexdump input string, fold 2 chars per line, cut the first char only
echo -ne '!±≡' | xxd -p|fold -2|cut -c1

2
c
b
e
8
a
f
a
b
b

(4 high order bits of an each input byte as a hex char, one per line)
Remove "continuation bytes" 0x80..0xBF
tr -d '89ab'

2
c

e

f

(what is left, is 4 bits of the first byte of an each unicode char)
map the first bits into the char length, collapse the output and print
echo `tr -t '01234567cbef' '[1*]2234'`

1 2 3 4

Test
 U() { xxd -p|fold -2|cut -c1|tr -d '89ab'|echo `tr -t '01234567cbef' '[1*]2234'`;}

 echo -ne '!' | U
 1

 echo -ne 'Ciao' | U
 1 1 1 1

 echo -ne 'tʃaʊ' | U
 1 2 1 2

 echo -ne 'Adám' | U
 1 1 2 1

 echo -ne 'ĉaŭ' | U
 2 1 2

 echo -ne 'ĉaŭ' | U
 1 2 1 1 2

 echo -ne 'チャオ' | U
 3 3 3
 echo -ne '!±≡' | U
 1 2 3 4

 echo -ne "\x0" | U
 1

 echo -ne '' | U

+1 Nice approach. You actually read the result directly from the input.

The -t option to tr was unfamiliar to me, and is apparently a GNU extension. Piping to the command substitution after echo might also be worth a slightly more detailed explanation.

PHP, 126 bytes
<?php $s=fgets(STDIN);echo $s!=''?implode(' ',array_map(function($x){return strlen($x);},preg_split('/(?<!^)(?!$)/u',$s))):'';

Try it online!

You can start your code with <?=($s=fgets(STDIN))?

C#, 89 82 bytes
I=>{var J="";foreach(char c in I){J+=Encoding.UTF8.GetByteCount(c+"");}return J;};

A simple C# lambda that iterates through the string and returns the space separated list.
Edit: saved 6 bytes thanks to some very nice comments.

pretty sure you can do var J="";...

Also, the OP states in a comment that you do not need to space-separate the output so 1121 and 1 2 1 2 are both OK

@cat Thanks, saved me 6 bytes

Also, you have an extra space in } return J;};

Seems like you need to using System.Text or thereabouts -- imports are not free.

Haskell, 85 bytes
import Data.ByteString as B
import Data.ByteString.UTF8
(B.length.fromString.pure<$>)

A little late, but this would be shorter as map$...

Pyth, 17 bytes
mhxS+11+16,7lCdlC

Try it online!
Use the code-point of the characters with some arithmetics.

There is a shorter answer alerady.

Factor, 57 87 82 80 bytes
[ [ dup zero? [ drop "1"] [ >bin length 4 /i 10 >base ] if ] { } map-as ""join ]

Explained:
USING: kernel math math.parser sequences ;
IN: byte-counts

: string>byte-counts ( str -- counts )
  [                  ! new quotation: takes a char as a fixnum
    dup zero?        ! true if this is a NUL byte
    [ drop "1" ]     ! NUL bytes have length 1
    [ >bin           ! else, convert to binary string
      length         ! length of binary string
      4              ! the constant 4
      /i             ! integer division
      number>string  ! 4 -> "4"
    ] if             ! conditionally execute one of the previous quotations
  ]                  ! end
  { } map-as         ! map and clone-like an { } array
  "" join ;          ! join array of 1strings on empty string

Unit tests:
USING: tools.test byte-counts ;
IN: byte-counts.tests

{ "1" } [ "!" string>byte-counts ] unit-test
{ "1111" } [ "Ciao" string>byte-counts ] unit-test
{ "1212"} [ "tʃaʊ" string>byte-counts ] unit-test
{ "1121" } [ "Adám" string>byte-counts ] unit-test
{ "212" } [ "ĉaŭ" string>byte-counts ] unit-test
{ "12112" } [ "ĉaŭ" string>byte-counts ] unit-test
{ "333" } [ "チャオ" string>byte-counts ] unit-test
{ "" } [ "" string>byte-counts ] unit-test
{ "1234" } [ "!±≡" string>byte-counts ] unit-test
{ "1" } [ "\0" string>byte-counts ] unit-test

They all pass, now. c:

C, 85 bytes.
l(unsigned char* c){while(*c){int d=(*c>>4)-11;
d=d<0?1:d+(d==1);putchar(48+d);c+=d;}}

Examines the high 4 bits of each byte to determine the encoding and the number of subsequent bytes to skip;

Does this work on null bytes?

Yes,  the while *c  exits on an empty string,  and the `c+=d' skips nulls in the middle of a multi byte codepoint.

That's incorrect. The end of a string (char*, really) in C is marked with a null byte. It is impossible to distinguish null bytes from the actual end of the string.

@Dennis Precisely because there is no difference :)

Right, but the OP said that null bytes must be supported.

ug. That was added after I wrote my answer.  I honestly don't see a way to do that while still handling c-style strings.

You really don't need the unsigned type specifier in there, regardless of whether chars are signed on a given platform or not -- modern platforms shouldn't have signed chars and anyways you can just say only works if your platform has unsigned chars

The OP stated in a comment (and it's now in the post) that you can request the length of the string in bytes as an argument, so do that and this will be valid again

F#, 59 54 66 bytes
(s)=seq{for c in s->System.Text.Encoding.UTF8.GetByteCount([|c|])}

Technically, s is a char sequence, but it turns out there's an implicit conversion that allows a string to be passed in.
When testing this in the console with !±≡, it splits the kanji into two characters, each 3 bytes long. All the other test cases work fine.
Edit: It turns out common namespace imports are not implicit. Up another 12 chars.

Timmy D's powershell answer has the same 6-bytes-per-kanji problem. I would attribute it to Windows being dumb and useless at Unicode. 2) If you get 6 bytes for the kanji when reading from a file enocded with UTF-8 without BOM then this is wrong and should be fixed. 3) Seems like F# needs statements like let f(x)= ... to end in ;;, like SML. 4) You can leave off assigning this anonymous function a name, i.e. (s)=seq{for c in s->Encoding.UTF8.GetByteCount([|c|])}.

Also, I get error FS0039: The namespace or module 'Encoding' is not defined when trying to run this. What am I doing wrong?

Also, welcome to Programming Puzzles and Code Golf, this is a nice first answer! :D

@cat You need to open the System.Text namespace.  I'm assuming namespace opens and entry code are included, coming from AstroDan's C# answer.

You need to count the bytes of any import, #include, open, load, require, using, USING: etc here on PPCG. AstroDan's C# answer is similarly erroneous, and I notified them of that.

Swift 2.2, 67 52 50 bytes
for c in i.characters{print(String(c).utf8.count)}

Horribly ugly.  There's no way to get the UTF-8 length of a Character in Swift, so I need to iterate through the string by character, convert the Character to a String, and find the count of that single-character String (hey, at least there's a built-in method to do that).  Looking for optimizations, possibly using a scanner.
Revision 1: Saved 15 bytes by using count instead of underestimateCount().
Revisions 2: Saved another 2 character by using a for-in loop instead of a for each closure.

jq, 26 characters
(23 characters code + 3 characters command line option)
(./"")[]|utf8bytelength

Hopefully competing. Although utf8bytelength was added 9++ months before this question, it is still not included in released version.
Sample run:
bash-4.3$ ./jq -R '(./"")[]|utf8bytelength' <<< 'tʃaʊ'
1
2
1
2

bash-4.3$ ./jq -R '(./"")[]|utf8bytelength' <<< 'ĉaŭ '
1
2
1
1
2
1

bash-4.3$ ./jq -R '(./"")[]|utf8bytelength' <<< 'チャオ'
3
3
3

bash-4.3$ ./jq -R '(./"")[]|utf8bytelength' <<< ''

bash-4.3$ ./jq -R '(./"")[]|utf8bytelength' <<< '!±≡'
1
2
3
4

Rust, 53 bytes
|s:&str|for c in s.chars(){print!("{}",c.len_utf8())}

Rust has utf-8 char primitives, iterators, and lambdas, so this was straightforward. Test code:
fn main() {
    let s = "Löwe 老虎 Léopard";
    let f =|s:&str|for c in s.chars(){print!("{}",c.len_utf8())};
    f(s);
}

Outputs
1211133112111114444

C (gcc), 53 bytes
k=49;f(char*s){*++s/64-2?k=puts(&k)+47:++k;*s&&f(s);}

Try it online!

SmileBASIC, 69 bytes
DEF C B
WHILE I<LEN(B)Q=INSTR(BIN$(B[I],8),"0")I=I+Q+!Q?Q+!Q
WEND
END

Input is an array of bytes.
The number of bytes in a UTF-8 character is equal to the number of leading 1 bits in the first byte (unless there are no 1s, in which case the character is 1 byte). To find the number of leading 1s, the program finds the first 0 in the binary representation, then adds 1 if this was 0.
0xxxxxxx - no leading ones, 1 byte
110xxxxx 10xxxxxx - 2 leading ones, 2 bytes
1110xxxx 10xxxxxx 10xxxxxx - 3 leading ones, 3 bytes
etc.

05AB1E, 15 bytes
ÇεDžy‹i1ë.²<5÷>

Try it online.
Header ε is used to for-each over all the test cases;
Footer ï]J]» to pretty-print the output character-lists (ï: decimals and characters to integers; ]: close if-else and for-each; J: Join digits together; }: close header foreach; »: Join by new-lines).
Explanation:
Ç                   # Convert each character to its unicode value
 εD                 # Foreach over this list
      i             #  If the current item
     ‹              #  is smaller than
   žy               #  128
       1            #   Use 1
        ë           #  Else
         .²         #   Use log_2
           <        #   minus 1
            5÷      #   integer-divided by 5
              >     #   plus 1

Since 05AB1E doesn't have any builtins to convert characters to amount of bytes used, I use Ç to convert the characters to their unicode values, and in a for-each do the following in pseudo-code:
if(unicodeValue < 128)
  return 1
else
  return log_2(unicodeValue-1)//5+1    # (where // is integer-division)

Inspired by @TheBikingViking's Python 3 answer.

Zsh, 41 bytes
for c (${(s::)1})set +o multibyte&&<<<$#c

Try it online!
Zsh is UTF-8 aware, so we split the string on characters, then disable multibyte and print each character's length.