Topic: Simple function to decode a text in utf8

Hello friends!
I do not know if this code will be useful since it is a very peculiar situation. Even so, I enjoyed that I was creating for my need and I decided to share with everyone.
It is a simple function that decodes a text with the encoding of characters in utf8.
Very useful, for example, when you want to bring the information of some page and the text has accented characters, characteristics of some languages like Portuguese and Spanish.
So, since almost all the pages are encoded in utf8, I really needed some way to decode them, but since there was nothing natively in bgt for this task, I decided to create my solution.
The code is very simple and from the few tests I did, it seems to work as expected.
I hope you enjoy it and make it useful! … e.bgt?dl=1

Re: Simple function to decode a text in utf8

That looks absolutely wonderful! Congrats on managing to do this. I believe it's actualy going to be useful to me in several cases in the future, so thanks for this a ton!

Re: Simple function to decode a text in utf8

Hi Lukas!
Glad the code might be useful to you at some moment. It may be that you still have some missing characters, I have placed those that are more common and that appear frequently.
It was a very immediate and very simple solution, I'm already challenging myself to go a little further, like creating a function to strip html tags, but even with functions for string manipulation, this still seems very hard for me.
If you or anyone else has any suggestions on how to get started, I would be very grateful.
I also take this opportunity to ask the following:
Do you have some of the codes / materials in bgt that were posted here that are no longer with the links working?
If so, I would like to get in touch with you so that you can send me.

Re: Simple function to decode a text in utf8


okay, I can perfectly understand that. If I ever need to add the specific diacritics of my language, I should have no issues just looking them up and adding them to the base myself.

As for HTML parsing and such, I agree, that's also something I've already thought of doing at some point myself, and I agree that it seems hard to even start thinking of with the current string manipulation functions avalable. I'll perhaps be able to discuss this more deeply when I actually delve into it myself.

I did have quite a lot of the more interesting scripts that had been posted over the years, and I still have them, sort of, but not immediately available. The problem is that my computer where I have accumulated all my BGT related data over the years, among other things, has just stopped working a month or so ago. Both its battery and the charging connector have stopped working gradually over time, but the connector is now at such a point that it fails to hold the cable for even a second, so using the machine is out of the question entirely. Since the connector is soldered to the mother board on this very machine, paying for a repair would literally equal a new computer that would already be moderately decent specwise. I'm currently in the process of getting a brand new computer, but this takes longer than expected since there is some state support funding involved in the process, it takes a whole lot of burreaucracy and patience, and it just takes ages to be fully resolved. To give you a better idea, I submitted the application and all the required paperwork in mid December, and it's still not fully done yet, however it shouldn't take longer than 3 or 4 weeks from now at the most, fortunately, for God's sake. :-D

So, right now I'm just on a transitional computer that I borrowed just so that I have something to do the absolute bare minimum of work on. It was made in 2010, has Windows 7 installed on it and seems to be 10 incompatible, has not had even a single incremental update installed for more than a year, still had loads of bloatware on it, has not been defragmented or even turned on for the same amount of time, e.g. a year, and has really quite poor specs. Only when I do get the new computer that I have applied for will I go to any lengths to have the hard drive from my old malfunctioned computer removed and put into an external box. So, I should have all my original data back at some point, at which moment I will be more than willing to contact you about the scripts that I have collected over time, but it won't probably be sooner than in a month from now. I have set a reminder on my phone right now, to get back to you with the includes when possible, so that I won't forget about it. It's entirely possible that I might have to postpone it even further than that though, by about a week or two, so don't be surprised if I'm not able to actually get back to you in exactly a month from now, ok? Thanks. :-)

Talk to you then, I'm really looking forward to it already!

Re: Simple function to decode a text in utf8

Hi Lukas, no problem.
I understand your situation perfectly, it's not a good thing to be without a machine.
This has happened to my desktop several times, even has a memory slote that seems not working anymore ....
About bgt includes, I asked because I started getting familiar with the language at the end of last year and since then I have seen a lot of interesting things done by the BGT community that I can not download because the links are broken, even the ones that already Were working before ...
I think it would be interesting to put all these codes in one place to avoid this kind of situation ...
Consequently, the people who were actively participating in the forum are already forgetting about it and you should agree with me that it is very much standing ...
For new bgt users, this is not good ....
This language within its limitations has a lot of potential ...
I have seen a person put a code made in bgt in github, would not it be a bad idea if bgt had its space in that repository?
Sharing something that can help us always enriches our knowledge.
I'll be waiting for you.
Good luck!

Re: Simple function to decode a text in utf8

I absolutely agree about a central repository. I was already seriously considering trying to host one myself, when I'm fully back up and running again. :-) And yes, it seems things are getting majorly delayed again... :-(
I'll certainly let you know as soon as I can.
And by the way, lots of congratulations for your strip HTML tags function. That's really a feat for the future usage of BGT and will definitely come in handy. Thanks a lot!