Localization / UTF support (Setting up a linear frame buffer)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Setting up a linear frame buffer without a BIOS

Post by Combuster »

Antti wrote:I wonder how it is possible to even have a "painfully slow" console.
By doing this on an USB photo frame :D
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: Setting up a linear frame buffer without a BIOS

Post by rdos »

glauxosdev wrote:So it is time to support them. Implementing UTF-8 is not hard, I did it in a single day.
I have UTF-8 support in the GUI library. I just don't think the console is a specialized "GUI app".
glauxosdev wrote: You will never see the beauty of Greek characters in your "console". :P
I can in the GUI. :-)
glauxosdev
Member
Member
Posts: 119
Joined: Tue Jan 20, 2015 9:01 am
Libera.chat IRC: glauxosdever

Re: Setting up a linear frame buffer without a BIOS

Post by glauxosdev »

Hi,
I have UTF-8 support in the GUI library. I just don't think the console is a specialized "GUI app".
No, it isn't. But I have to tell you for nth time that a "console" has to have UTF-8 support (or any other Unicode encoding for that matter). Really, just stop.
Sokrates wrote:Ἓν οἶδα, ὅτι οὐδὲν οἶδα.
It means "All I know is that I know nothing". Adopt this quote to your own life and stop thinking you are the superior one here.

Also, save this quote as a file and show it in the "console" at start-up. Maybe you will learn someday...

Regards,
glauxosdev
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Setting up a linear frame buffer without a BIOS

Post by gerryg400 »

glauxosdev wrote:No, it isn't. But I have to tell you for nth time that a "console" has to have UTF-8 support (or any other Unicode encoding for that matter). Really, just stop.
You should stop. Keep your opinion about what someone else's console should do and should not do to yourself.
If a trainstation is where trains stop, what is a workstation ?
Octocontrabass
Member
Member
Posts: 5588
Joined: Mon Mar 25, 2013 7:01 pm

Re: Setting up a linear frame buffer without a BIOS

Post by Octocontrabass »

rdos wrote:OTOH, I don't support UTF-8 filenames anyway, so the whole issue is non-relevant.
So your GUI can be fully localized, except file names, which must be written in Latin characters even if the local language is something like Arabic, which has no standard representation in Latin characters. :|
rdos wrote:You want the commands to be the same in different languages, and you also want the OUTPUT from the commands to be (because otherwise you cannot parse results programatically).
You want the error messages to be in the user's language. You should not be parsing error messages programmatically; that's what return values are for.
rdos wrote:Today you can easily expect people that use the console to be knowledgeable in English.
I'm not so sure about that.
rdos wrote:Typical users no longer use the command shell, they expect something better than that.
And I'm sure your GUI that forces all file names to be written in Latin characters will be very popular. :roll:
glauxosdev
Member
Member
Posts: 119
Joined: Tue Jan 20, 2015 9:01 am
Libera.chat IRC: glauxosdever

Re: Setting up a linear frame buffer without a BIOS

Post by glauxosdev »

Hi,

I agree it leads nowhere...

Regards,
glauxosdev
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: Localization / UTF support (Setting up a linear frame bu

Post by Candy »

Split off this topic for the localization discussion.

My view is that we shouldn't localize anything, but do allow the user-generated content to be user-localized. Your app uses standard names for things and it's the same for everyone (so you can google them and so on), but the stuff you make can use unicode names and so on.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Localization / UTF support (Setting up a linear frame bu

Post by Brendan »

Hi,
Candy wrote:My view is that we shouldn't localize anything, but do allow the user-generated content to be user-localized. Your app uses standard names for things and it's the same for everyone (so you can google them and so on), but the stuff you make can use unicode names and so on.
My view is that GUI has dominated since the 1990s; studies have shown that things like icons and WYSIWYG and "discoverable" user interfaces are far easier for users; the ability to script GUI apps has been around for at least 20 years now (Applescript, 1993); and I expect we've all recognised a trend towards mobile devices that don't have a keyboard (and use touch instead, where entering text is clumsy and GUI is far more suited). With these things in mind; a truly modern OS (e.g. where backward compatibility with ancient/obsolete things like CP/M and Unix aren't important) simply shouldn't have a console in the first place.

Therefore; when implementing a console the primary goal should be to minimise wasting developer time on something that ideally shouldn't exist. That would imply recycling the same "text output" code that GUI apps use to avoid wasting developer time on things like supporting text mode and having special "ASCII only" text processing (in addition to the "Unicode text processing" that you have for GUI text boxes, etc); especially when you consider "console running in a window" where it's all going through the GUI anyway. Most (all?) GUIs support full screen applications, and "full screen console" really doesn't deserve to be a special case.

Basically; console should support Unicode, not because it's important to support Unicode, but because OS developers have better thing to do than waste time implementing unnecessary "ASCII only" support. 8)


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: Localization / UTF support (Setting up a linear frame bu

Post by Antti »

rdos wrote:If you send UTF-8 filenames to a real textmode console, it will print some funny characters, that's all.
It might be a valid design decision but you could still handle UTF-8 strings but not render the non-ASCII characters. A band name Motörhead could be encoded as a byte sequence (in hex): 4D 6F 74 C3 B6 72 68 65 61 64.

You could print this in three ways:
  • Motörhead. Correct way.
  • Mot?rhead. UTF-8 supported but not rendered. Acceptable.
  • Motörhead. UTF-8 not supported at all and the string length is "undefined". Worst.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: Localization / UTF support (Setting up a linear frame bu

Post by Candy »

Brendan wrote:console should support Unicode, not because it's important to support Unicode, but because OS developers have better thing to do than waste time implementing unnecessary "ASCII only" support. 8)
Yes.

I've named my new OS attempt Rødvin so as to force myself to get it right everywhere. If you cannot do unicode somewhere you can't even print the OS name.

Incidentally, it has a console as part of its graphics mode stuff - because I didn't want to waste time implementing ascii-only text mode.

Having everything the same encoding and converting at the door means all internal logic is much simpler.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: Localization / UTF support (Setting up a linear frame bu

Post by rdos »

Brendan wrote: Basically; console should support Unicode, not because it's important to support Unicode, but because OS developers have better thing to do than waste time implementing unnecessary "ASCII only" support. 8)
Sure, but I didn't waste any time when I did this maybe 20 to 25 years ago, when the available video-modes were really crappy and I didn't even have a GUI because of it. If I did it today, I might have wasted time, but not back then. ;-)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Localization / UTF support (Setting up a linear frame bu

Post by Combuster »

The biggest problem comes when you have files existing on a medium, and you can't do anything with them because you can't enter its filename in any way.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
bigbob
Member
Member
Posts: 122
Joined: Tue Oct 01, 2013 2:50 am
Location: Budapest, Hungary
Contact:

Re: Localization / UTF support (Setting up a linear frame bu

Post by bigbob »

Combuster wrote:The biggest problem comes when you have files existing on a medium, and you can't do anything with them because you can't enter its filename in any way.
Perhaps it's not an elegant solution but my Non-Unicode OS can read files with unicode chars from Fat32 on pendrives simply by skipping the unicode chars that are greater than 127 during comparisons. When I print the filenames I print an 'x' instead of (non-ascii) unicode chars. This way I can cd directories-with-unicode-names too.
Similarly when I need to enter a filename in my OS that has unicode chars on the USB-Fat32 filesystem, I print an 'x' at the position of the unicode char (but it will be skipped, so it could be any char). For example: Kxbenhavn (where x is that crossed 'o').
The OS is simple this way.
Last edited by bigbob on Fri May 29, 2015 4:55 am, edited 1 time in total.
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: Localization / UTF support (Setting up a linear frame bu

Post by alexfru »

bigbob wrote:my Non-Unicode OS can read files with unicode chars from Fat32 on pendrives simply by skipping the unicode chars that are greater than 127 during comparisons. When I print the filenames I print an 'x' instead of (non-ascii) unicode chars. This way I can cd directories-with-unicode-names too.
Is there any resolution for possible ambiguity? E.g. what if you have files named filé and filè, how do you distinguish fil from fil or filx from filx?
bigbob
Member
Member
Posts: 122
Joined: Tue Oct 01, 2013 2:50 am
Location: Budapest, Hungary
Contact:

Re: Localization / UTF support (Setting up a linear frame bu

Post by bigbob »

alexfru wrote:
bigbob wrote:my Non-Unicode OS can read files with unicode chars from Fat32 on pendrives simply by skipping the unicode chars that are greater than 127 during comparisons. When I print the filenames I print an 'x' instead of (non-ascii) unicode chars. This way I can cd directories-with-unicode-names too.
Is there any resolution for possible ambiguity? E.g. what if you have files named filé and filè, how do you distinguish fil from fil or filx from filx?
Well, that's a problem. The first file will be found in your case.
Have no filenames like those ones :)
I think it's worth it because of the simplicity of the OS.
EDIT: the length of the filename matters too, so only filX and filY are ambigous, where X and Y are unicode chars.
Last edited by bigbob on Fri May 29, 2015 7:23 am, edited 1 time in total.
Post Reply