<postmodern>
is there a way of getting the encoding of a String ? I noticed you can call String#encode to encode the String into another encoding, but how do I determine the encoding of a String
<FromGitter>
<Blacksmoke16> wouldnt it always be UTF-8
<FromGitter>
<Blacksmoke16> `#encode` returns `Bytes` so yea...
<postmodern>
hmm
<postmodern>
so when you encode a String or create a String.new with an encoding, it really just converts back down to UTF-8 again?
<postmodern>
also does String#tr not support "^\xHH-\xHH" char ranges?
<postmodern>
trying to do `string.tr("^\x20-\x7e", ".")`
<FromGitter>
<Blacksmoke16> idk about the converting part, is possible it just wouldnt be valid
<FromGitter>
<Blacksmoke16> checks if the char is in any unicode control category
<postmodern>
would that also include unknown unicode code points?
postmodern has quit [Remote host closed the connection]
<FromGitter>
<HertzDevil> what do you mean by "unknown"
<FromGitter>
<HertzDevil> the General_Category of a code point is always "known" in the sense that all unassigned code points and non-characters have the value Cn
<FromGitter>
<HertzDevil> though of course the same codepoint's General_Category could be changed as `Unicode::VERSION` increments (as we did a few days ago)
<FromGitter>
<Dan-Do> when compiling a project with C binding, compiler said `undefined fun 'ejdb_init' for EJdb::LibEjdb` ⏎ The function is there in the lib `fun init = ejdb_init : Iwrc`. What else should be investigated?
<FromGitter>
<naqvis> you need to find which library have this method , then link that as well
<FromGitter>
<naqvis> all you have to do is look into how your target library compiles or have external dependencies, then link them together
<FromGitter>
<Dan-Do> That's so great! I solve it, we need to add more static files, like this ⏎ `@[Link(ldflags: "#{__DIR__}/lib_1.a #{__DIR__}/lib_2.a #{__DIR__}/.....a")]`
<FromGitter>
<Dan-Do> If I added `pointerof` to `LibEjdb.close(pointerof(@db))` the error went. This question is, in the lib, those two function's parameter `ejdbp` is declared the same `ejdbp : Ejdb*`, why in crystal we have to add `pointerof` at the `close`?
<FromGitter>
<Dan-Do> The question is, in the lib, those two function's parameter `ejdbp` is declared the same `ejdbp : Ejdb*`, why in crystal we have to add `pointerof` at the `close`?
<FromGitter>
<DRVTiny> But Proc is a new object created from method. And what is method itself?
<FromGitter>
<HertzDevil> what's the problem with that
<FromGitter>
<DRVTiny> I want some proc that accepts name of other procs to call, such as ⏎ call_this_procs(proc1, proc2, proc3) ⏎ It is very frustraing syntax call_this_procs((->proc1), (->proc2), (->proc3)) for such simple thing ⏎ But... i can use macroses eventually... [https://gitter.im/crystal-lang/crystal?at=61559235ee6c260cf7f1c325]
<FromGitter>
<DRVTiny> For example, in golang i can ⏎ func call_fns(fns ...func(int) int) { } ⏎ call_fns(func1, func2, func3)
<FromGitter>
<HertzDevil> that's because they are functions, and methods are not functions
<FromGitter>
<DRVTiny> class itself is an instance of class "Class" :)
<FromGitter>
<DRVTiny> But what is method? ;)
<FromGitter>
<HertzDevil> but crystal never purports to be "totally oop-driven" in the first place
<FromGitter>
<HertzDevil> such a method would not be quite the same thing as ruby's `Method` and `UnboundMethod`, as we have overloading
Volk has quit [Remote host closed the connection]
<FromGitter>
<HertzDevil> in ruby it's even more cumbersome as you have to do `x.method(:f)` instead of `->x.f`
<FromGitter>
<postmodern:matrix.org> er I meant unicode codepoints that do not map any visible character, but instead get printed as that square with the numbers in it. For example codepoint 888 or ``. Appears that `888.chr.control?` returns `false`, so I guess control only covers explicit control characters.
postmodern has joined #crystal-lang
<postmodern>
why can't you define a range of Chars in macros?
<FromGitter>
<asterite> Maybe we are not passing an option...
<FromGitter>
<asterite> Yup, that's it
<FromGitter>
<asterite> Could you report a bug? Mentioning that we need to use `PCRE_UCP` when compiling regexes (maybe when matching too, I don't know)
<postmodern>
done
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #crystal-lang
dostoyev1ky2 has joined #crystal-lang
Starfoxxes has quit [*.net *.split]
dostoyevsky2 has quit [*.net *.split]
Vexatos_ has joined #crystal-lang
Starfoxxes has joined #crystal-lang
Vexatos has quit [Ping timeout: 265 seconds]
repo1 has joined #crystal-lang
repo has quit [Ping timeout: 265 seconds]
human_g33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 265 seconds]
dostoyev1ky2 has quit [Quit: leaving]
dostoyevsky2 has joined #crystal-lang
postmodern has quit [Read error: Connection reset by peer]
DeBot has quit [Ping timeout: 246 seconds]
straight-shoota has quit [Ping timeout: 260 seconds]
wolfshappen has quit [Ping timeout: 252 seconds]
jhass has quit [Ping timeout: 264 seconds]
brw has quit [Ping timeout: 268 seconds]
brw has joined #crystal-lang
DeBot has joined #crystal-lang
wolfshappen has joined #crystal-lang
jhass has joined #crystal-lang
straight-shoota has joined #crystal-lang
ur5us has joined #crystal-lang
notzmv has quit [Ping timeout: 250 seconds]
notzmv has joined #crystal-lang
Volk has joined #crystal-lang
Volk has quit [Changing host]
Volk has joined #crystal-lang
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
notzmv has quit [Read error: Connection reset by peer]
notzmv has joined #crystal-lang
Volk has quit [Quit: See you next time!]
xyhuvud has quit [Remote host closed the connection]