All pastes #434096 Raw Edit

mehul

public text v1 · immutable
·published 2007-04-11 06:32 UTC
rendered paste body
Apr 11 02:13:52 <mehulved>	hello. can anyone tell if ASCII value 1 can print a smiling face on linux or it works only on windows?
Apr 11 02:15:59 <SamB>	mehulved: I thought it worked only in DOS!
Apr 11 02:17:22 <mehulved>	SamB, actually yeah it works only in cmd prompt on windows. actually I am just starting to learn C and came across this so I am a bit confused here
Apr 11 02:17:43 <Agathezol>	mehulved: the 'smiling face' your seeing is a glyph that is implementation dependant. it is being used to represent the non-printable ascii character SOH (start of heading). See http://www.asciitable.com/ for a full ascii table.
Apr 11 02:18:19 <SamB>	I thought it was the face of the evil smiling Objects in ZZT!
Apr 11 02:19:21 *	SamB prefers #char 2 white on blue
Apr 11 02:19:25 <mehulved>	Agathezol, i didn't get the whole thing you said but from what I get, you mean that the smiling face depends on the OS?
Apr 11 02:23:27 <Agathezol>	mehulved: yup, OS, program, possibly the terminal settings your using. If you look at that table you'll notice there is no 'smiling face' character in the list
Apr 11 02:24:48 <mehulved>	Agathezol, yeah saw it, no smiley face there. and it's not just my system, it didn't work on ubuntu, fedora and solaris, of the people who tried but worked fine on windows
Apr 11 02:25:19 <mehulved>	thank you Agathezol and SamB 
Apr 11 02:26:18 <SamB>	for instance, if you upload a different font to the videocard in DOS, you might get something different for char 1 ;-)
Apr 11 02:28:24 <mehulved>	SamB, ok. so is it possible to do it under linux? not that i'd do it but just to know
Apr 11 02:28:45 <C_Dreamer>	mehulved: of course it's possible. All you have to do is write your own font.
Apr 11 02:28:56 <SamB>	yes! the POSIX way to make a smiley is ";-)"
Apr 11 02:29:02 <SamB>	or possibly ":-)"
Apr 11 02:30:24 <mehulved>	C_Dreamer, ok. anyways that's beyond me for now.
Apr 11 02:30:54 <C_Dreamer>	Yes, a man should know the length of his skill
Apr 11 02:32:16 <mehulved>	yeah :-)
Apr 11 02:32:56 <SamB>	actually, if you cheat you can just upload a copy of the font from your VGA BIOS, I *think*...
Apr 11 02:33:32 <hrnt>	using bios is cheating
Apr 11 02:33:38 <SamB>	but that only works on the console, and only if it isn't doing unicode or something...
Apr 11 02:33:49 <SamB>	hrnt: well, you wouldn't use BIOS to upload it
Apr 11 02:33:55 <mehulved>	SamB, i don't really want to mess with anything. i can just let it pass, am just learning the basics of C for now
Apr 11 02:34:05 <SamB>	you'd just dump the font from the bios in the first place
Apr 11 02:34:44 <SamB>	and I'm only guessing about where the font is located, anyway...
Apr 11 02:36:24 <Coffee>	SamB: How may a BIOS write be performed?
Apr 11 02:36:34 <SamB>	you don't write to BIOS!
Apr 11 02:37:25 <Coffee>	Well, the memory to which BIOS is assigned, hten
Apr 11 02:38:19 <SamB>	you don't do that
Apr 11 02:38:23 <hrnt>	samb: i don't know how the font upload is performed, but i would guess it's either a) copy the font to a memory location b) tell vga adapter that you are going to write a font (writing to a port) and then write it to a memory location or c) same as b, except you would use an interrupt to tell the bios that you are uploading a font somewhere
Apr 11 02:38:47 <SamB>	there is a commandline program for it in Linux
Apr 11 02:38:50 <hrnt>	samb: alternative c would use bios to upload the font, technically ;)