# What is a character encoding, exactly?

### Preface

I've 'failed' twice at this whole golf language design thing, once with JAISBaL and again with Clack. Now that I've had a go twice, I am obviously an expert and am attempting to design the perfect golfing language. One of the things in particular that annoys me about Clack, JAISBaL, Jelly, APL, etc. is the fact that they have some wonderfully strange characters. Not only can they be difficult to type (Jelly being the exception here), but I prefer just seeing some ASCII source code. Therefore, before I create my new language, I'm designing a character encoding. The standard character encoding, is of course, just a code page, but my encoding is a little different.

### The Encoding

The idea is that the encoding only uses ASCII characters, but certain 2-character pairs are encoded as one byte. For example, a-zA-Z are all encoded as one byte, but @, ~ or _ followed by any a-zA-Z are also encoded as one byte. This means that, with this encoding, @A, ~x and _r are all one byte. There's other things that are strange to, such as " changing the behavior of the encoding itself, rather than just beginning a string, and the fact that ~@_ won't actually have there own bytes in the encoding, but will only serve as prefixes.

Encoding specification draft (may need refinement):

a-z A-Z = 52 bytes

~ @ _ = 156 bytes

!#$%^&*()-+={}[]:;'<>,.?/\|1234567890 = 38 bytes \n \t space = 3 bytes "0 "1 "2 "3 "r "c "g = 7 bytes --------------------------------------------------- a-z, A-Z and !#$%^&*()-+={}[]:;'<>,.?/\|1234567890
will each be represented by a single byte.

~ @ and _ will be prefixes, each can be followed by
any of a-z A-Z, each of these pairs will be encoded
with a single byte.

\n \t and space will each be represented by a single
byte.

"0 "1 "2 "3 will signify the start of a string, and
will each be represented as 1 byte:
- 0, 1, 2, 3 = use escape byte #0, #1, #2, or #3

"r "c "g will signify the end of a string and will
each be represented as 1 byte:
- r = raw utf8
- c = compressed
- g = gzip


### Question

Basically, is this allowed? Do we have any standards regarding how character encodings work? A loophole had been posted that forbade compression of source code (which this borders on), but it was downvoted & deleted, so I don't think I need to worry about it... UTF8 and the like also don't have a 1 byte = 1 character encoding, but the difference is that every character in this encoding would be 1 byte, or less than that... Would there be any reason this would be forbidden or banned? Thanks for any help!

• I don't see any problem. As long as your interpreter/compiler can actually run weird-looking single-byte code (not needing it to be decoded first), it is just a language. Compare to TI-BASIC which encodes apparently long identifiers as single or two-byte tokens. – Adám Jun 27 '17 at 12:48
• That's not a problem, but a user must actually be able to run the single-byte code without any other steps. – Adám Jun 27 '17 at 12:55
• @Adám silly me... you mean decoded by hand first... yes that makes sense, it should be fine then, thanks... it'll all be bundled up in one program anyway :) – Socratic Phoenix Jun 27 '17 at 12:55
• Why is Jelly the exception? Is there an easy way to type the dot-above/dot-below letter characters that I'm not aware of? – scatter Jun 27 '17 at 16:06
• @Christian I'm not entirely sure how too, but the codepage says they are easy to type – Socratic Phoenix Jun 27 '17 at 16:30
• @Christian I'm assuming Alt codes – Stephen Jun 28 '17 at 22:41
• @SocraticPhoenix you need to have your keyboard set to "international layout." Says so on that page you linked. – Draco18s Jul 6 '17 at 14:09