0

I have the following numeric bytes that I would like to find out the character representation for, where/how do I do this?

239 187 191 104
1
  • What encoding are they in? Without knowing that, it's impossible to answer. Commented Jan 19, 2015 at 13:15

2 Answers 2

1

Call chr method on each of these:

[239, 187, 191, 104].map(&:chr)
#=> ["\xEF", "\xBB", "\xBF", "h"]


# tilde, the last printable character
126.chr
#=> "~"

I think starting 127 would be non-standard chars

Sign up to request clarification or add additional context in comments.

2 Comments

Just a follow-up, "h" makes sense, but the others not - any idea how I can understand what they "mean"?
@Numbers I am sure it is some non-standart chars, but truly to say don't know yet how to understand it
1

Use the method chr of fixnum. Like so:

239.chr => "\xEF"

If your input is a space separated string, you may use split and map:

"239 187 191 104".split.map(&:to_i).map(&:chr)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.