ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
notzmv has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
ur5us_ has joined #crystal-lang
renichbon has quit [Quit: Leaving]
ur5us_ has quit [Quit: Leaving]
ur5us has joined #crystal-lang
Starfoxxes has quit [Ping timeout: 268 seconds]
Starfoxxes has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 256 seconds]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Client Quit]
notzmv has quit [Ping timeout: 245 seconds]
taupiqueur has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 245 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 250 seconds]
<FromGitter> <zblesk:zble.sk> I have a list of strings which contain letters that have diacritics, or chinese characters, things like that. ⏎ Is there anything I could use to convert them to latin-alphabet-only slugs, or safe filenames?
notzmv has joined #crystal-lang
<FromGitter> <Blacksmoke16> @zblesk:zble.sk for a `content-disposition` header?
<FromGitter> <Blacksmoke16> be fairly easy to just replace those chars with some other char, but translation to their latin equivalent sounds quite challenging
<FromGitter> <zblesk:zble.sk> no. I will be using it for various places, like unique URLs or image file names.
<FromGitter> <zblesk:zble.sk> I could forgo the translation.
<FromGitter> <zblesk:zble.sk> How would I do that replacement?
<FromGitter> <Blacksmoke16> `fallback_filename = filename.gsub { |chr| chr.ascii? ? chr : '_' }` is how i handle it
<FromGitter> <zblesk:zble.sk> but that just deletes anything that isn't ASCII, it looks like?
<FromGitter> <Blacksmoke16> pretty much yea
<FromGitter> <zblesk:zble.sk> I would like to at least preserve chars and strip them of diacritics.
<FromGitter> <zblesk:zble.sk> I know that such a thing can normally be done with Unicode by converting the string into the decomposed form, stripping non-letter codepoints and then composing it again. ⏎ I have checked the String docs, and I currently don't see how I would do that in Crystal.
taupiqueur has quit [Quit: taupiqueur]
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> have an example in ruby or another lang?
<FromGitter> <zblesk:zble.sk> I only did it in dotnet
<FromGitter> <zblesk:zble.sk> would that help?
<FromGitter> <Blacksmoke16> :shrug: maybe
<FromGitter> <zblesk:zble.sk> string.Concat( ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ).Normalize(NormalizationForm.FormC); [https://gitter.im/crystal-lang/crystal?at=623b1ddcf43b6d783f15e428]
<FromGitter> <zblesk:zble.sk> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=623b1dea0466b352a43121ee]
<FromGitter> <Blacksmoke16> looks like ruby can do this via `I18n.transliterate` tho idt there is an implementation of that, at least in stdlib ofc
<FromGitter> <zblesk:zble.sk> ah, thanks
<FromGitter> <zblesk:zble.sk> I mostly needed this for smaller scripts or apps. Unless someone else has any other idea, I guess I might implement it in dotnet instead.
<FromGitter> <zblesk:zble.sk> Thank you again for your help!
<FromGitter> <Blacksmoke16> yea im thinkin we dont have a way to normalize the char
<FromGitter> <Blacksmoke16> i know Grapheme support is new coming up, but idt thats what you want
<FromGitter> <Blacksmoke16> @zblesk:zble.sk https://github.com/crystal-lang/crystal/issues/11223 probably what you'd be looking for?
<FromGitter> <zblesk:zble.sk> ah, that seems to be it.
spuun has joined #crystal-lang
sorcus has quit [Quit: WeeChat 3.4]
nq has quit [Ping timeout: 268 seconds]
nq has joined #crystal-lang
sorcus has joined #crystal-lang
renich has joined #crystal-lang
<FromGitter> <nickwesselman> Hey y'all. 👋 ... new to Crystal but heard about the merge of WASM/WASI support and wanted to take it for a spin. I compiled from master and attempted a hello world... seems like I'm missing something in the `wasm-ld` arguments. There's also a `wasm-ld` command output by the build that doesn't work at all for me. ⏎ ⏎ ```code paste, see link``` [https://gitte
<FromGitter> ... r.im/crystal-lang/crystal?at=623b68c03ae95a1ec1b29e83]
<FromGitter> <nickwesselman> ```code paste, see link``` ⏎ ⏎ Now that I read it, I think this is the error I need to fix. :) Need libc in my /opt/homebrew/lib I assume. [https://gitter.im/crystal-lang/crystal?at=623b6bdc9bd1c71ecab888d6]
<FromGitter> <nickwesselman> Making some progress but seeing other issues, will post in forum instead.
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
nq has quit [Quit: Leaving]