Welcome, Guest. Please login or register.
April 18, 2014, 05:37:43 AM
Home Help Search Login Register
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base

Qbasicnews.com  |  QBasic  |  QB Discussion & Programming Help  |  Topic: Please provide ASCII codes for Spanish characters. « previous next »
Pages: [1] 2 3 Print
Author Topic: Please provide ASCII codes for Spanish characters.  (Read 4934 times)
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« on: November 09, 2003, 12:02:58 AM »

Friends, I need your help.

At work here in Mexico, I'm trying to convince management to set a standard not to allow Spanish characters with diacritical marks (accented vowels, n with tilde, etc.) to be entered into the system.

I have been involved with systems for Spain, Mexico and other Latin American countries for 20 years, and have had many problems because of these characters, the main problem being that the ASCII codes for these characters are not always the same, causing the following problems on a networked system:

* Using these characters as part of a "key" may result in not being to access that key when using a different terminal (PC).

* Using these characters as part of a user-ID or password may result in not being able to login from another terminal (PC).

* Displaying these characters on the screen of another terminal (PC) may result in weird characters being displayed.

* Printing these characters on a different printer may result in weird characters being printed.

The argument that I get is: "We're in Mexico, and these characters are part of the Spanish alphabet." True, but not all operating systems are the same, and all PC's are not the same. If you look around in large companies here in Mexico you will find different versions of Windows, different makes of PC's with different keyboards.

I don't have any documented evidence of this, but I know this from experience.

EXAMPLE:
Let's just look at 2 characters, the lowercase "a" with an accent , and the lowercase "n" with a tilde.
In MSDOS, the ASCII code for the accented "a" is hex "A0",
In WindowsXP, the code is hex "E1".
In MSDOS the ASCII code for the "n" with a tilde is hex "A4",
in WindowsXP, the code is hex "F1".

YOUR HELP, PLEASE.
What are the corresponding codes for these 2 characters on the PC that you are using? The MSDOS codes I expect will be the same, but let me know anyway.

Since you guys live in many different countries, I'll use your input and feedback to support my argument.

Thanks,
Moneo
*****
Logged
Plasma
Na_th_an
*****
Posts: 1769



WWW
Please provide ASCII codes for Spanish characters.
« Reply #1 on: November 09, 2003, 12:42:12 AM »

Same as yours:

A0 and E1 for
A4 and F1 for

(I know for MS-DOS it depends on the codepage)
Logged
na_th_an
*/-\*
*****
Posts: 8242



WWW
Please provide ASCII codes for Spanish characters.
« Reply #2 on: November 09, 2003, 12:53:25 AM »

Yeah. In Windows the issue is fixed since v.3.0 where they introduced the OEM charset. Anyhow, this is how the extended ASCII look in my computer (128-255):



This is using CP = 850. 437's are in the same place but most diacriticals are lost as well as caps.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #3 on: November 09, 2003, 02:37:25 AM »

Gracias, Nathan.

That's the MSDOS character set which looks the same for the diacriticals. Write some accented vowels and n with tilde in Notepad, and then use some hex text editor to see what the ASCII is.

Thanks again.
*****
Logged
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #4 on: November 09, 2003, 03:12:15 AM »

Plasma,
Thanks. I had thought that for these characters the ASCII code in Windows in the USA might have been different. The machine I'm using has an English version of WinXP, but has a Spanish keyboard for the benefit of my wife and children. Maybe the English version of WinXP gives me the same ASCII values as your machine.

I've come across versions of Windows in Spain, Mexico, and Latin America where the ASCII codes for these Spanish characters are different, but I never actually documented the fact. Now I'm having troubles proving it.
Have you got any ideas on the subject?
Thanks again.
*****
Logged
SCM
Wandering Guru
***
Posts: 311



Please provide ASCII codes for Spanish characters.
« Reply #5 on: November 09, 2003, 03:16:34 AM »

You can read them using Character Map.  In Win 98, my version of Character Map shows the keystroke for each character in the bottom right corner.  For extended characters it is Alt + 0XXX, where XXX is the character code.  


N with a tilde is 209
A with accent is 193
E with accent is 201
I with accent is 205
O with accent is 211
U with accent is 218

for lower case add 32
Logged

hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)

For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #6 on: November 09, 2003, 03:27:31 AM »

SCM,

Are you sure about these codes? They look totally different than what I've seen.

Try using your codes, get into Notepad, and using ALT and these codes, see if it displays the coresponding accented characters or the n with the tilde. Then let me know.

Thanks.
*****
Logged
SCM
Wandering Guru
***
Posts: 311



Please provide ASCII codes for Spanish characters.
« Reply #7 on: November 09, 2003, 04:16:23 AM »

I couldn't get it to work the way you said, so I pasted from Character Map, then read the Hex codes:
Code:
     Hex   Dec                Hex   Dec
   &HC1 = 193              &HE1 = 225
   &HC9 = 201              &HE9 = 233
   &HCD = 205              &HED = 237
   &HD1 = 209              &HF1 = 241
   &HD3 = 211              &HF3 = 243
   &HDA = 218              &HFA = 250

This is the same results I had before, and it does agree with what others have posted here.  I may have confused you by using caps or decimal notation (I was just to lazy to convert to hex).
Logged

hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)

For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
na_th_an
*/-\*
*****
Posts: 8242



WWW
Please provide ASCII codes for Spanish characters.
« Reply #8 on: November 09, 2003, 11:51:45 AM »

As I said, OEM codes are fixed, as well as unicode codes. Charmap is at Start->Accesories->System tools. You can check the codes here.

If you want your keyboard to work under windows and to generate correctly you have to configure it under control panel.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #9 on: November 09, 2003, 02:37:01 PM »

SCM,

Thanks again.
Since you most probably don't have a Spanish keyboard, then you have to resort to other means, like what you did, to generate these Spanish characters.

The results that you are showing support my argument that not every PC issues the same ASCII codes for these characters. Just for the record, please give me the specs on your PC: name/model PC, operating system name/version, keyboard layout.
*****
Logged
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #10 on: November 09, 2003, 03:02:12 PM »

Quote from: "na_th_an"
As I said, OEM codes are fixed, as well as unicode codes. Charmap is at Start->Accesories->System tools. You can check the codes here.

If you want your keyboard to work under windows and to generate correctly you have to configure it under control panel.

NATHAN,

I know that OEM means Original Equipment Manufacturer, but I am not familiar with its usage as the OEM character set for Windows. As far as Unicode is concerned, there are a myriad of exceptions and interpretations of this 16 bit code, and whether you can just use the first 8 bits.

I'm not sure whether these global considerations (OEM and Unicode) have any bearing on the problem. Again, the problem is that within the last 2 years, in different Spanish speaking countries,  I have seen PC's generate different ASCII codes for the subject Spanish characters. Whether this was due to the OEM charset, or Unicode, or the version of Windows (95 and beyond). or whether the PC was configured using the Control Panel, I don't know, I just saw the effects.

If you consider that there could be some global consideration, then please explain this in detail. However, I you agree with me that there could be several factors involved in causing the different ASCII codes, then please run some tests on your machine from Windows applications. I'm sure you have a Spanish keyboard, so type some of these characters into Notepad and then see what the ASCII code is.

Gracias, Nathan. Este es un tema de nunca acabar. Pocas personas han percibido este problema porque no han tenido acceso a diferentes PCs en diferentes paises.
*****
Logged
Anonymous
Guest
Please provide ASCII codes for Spanish characters.
« Reply #11 on: November 09, 2003, 03:12:45 PM »

AOL's SmarterChild says:

Translated from Spanish to English, your text becomes:

"Thanks, Nathan. This it's a subject never to finish. Few people have
perceived east problem because they have not had access to different
PCs in different paises."

[conclusion removed by oracle]
Logged
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #12 on: November 10, 2003, 01:21:27 AM »

Come on, you guys out there with Spanish keyboards, help me out with some input.
*****
Logged
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
Please provide ASCII codes for Spanish characters.
« Reply #13 on: November 10, 2003, 08:25:44 AM »

My spanish keyboard just sends the screen the char it is supposed to send Cheesy

Only there is two char sets, one for DOS (ASCII extended,called OEM in Windows) and one for Windows (ANSI set). Both sets are the same for the chars 32-127 but differ for the chars with diacritical signs. There are Windows fonts using  ANSI set and fonts using OEM set. The ROM fonts are OEM.

You can have the ANSI set by running this script. Just save it with .vbs extension and ouble click it.You must have windows scripting enabled.
Code:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("C:\Chars.txt")
For i = 129 to 255    
    objfile.writeline("char"&cstr(i%)&"= "&chr(i)&" ")
Next
objfile.close
Msgbox("Done")


For OEM you can build easily  an equivalent QB program..

You can have the chars from the ANSI set with ALT+Numeric pad, preceding the char number by a 0. If the char number does not start by 0 you have the OEM set.

The problem is to read  with a DOS app a document built by a Windows app or the reverse. Also printing a Windows doc with a printer using an OEM set or reverse.

Probably the solution for your problem would be using accented chars for the fields (en espaol, co*o! Cheesy ), and build indexes using plain ASCII, so the search works.
Logged

Antoni
Moneo
Na_th_an
*****
Posts: 1971



Please provide ASCII codes for Spanish characters.
« Reply #14 on: November 11, 2003, 12:04:11 AM »

Quote from: "Antoni Gual"
My spanish keyboard just sends the screen the char it is supposed to send Cheesy

Gosh, Antoni, you must have paid extra for that, ha ha.

Quote
Probably the solution for your problem would be using accented chars for the fields (en espaol, co*o! Cheesy ), and build indexes using plain ASCII, so the search works.

That's a good idea except that the diacritical characters in the data fields print on the screen and printer as different characters depending on the configuration of the PC of the user that entered the data.

Could you enter some diacritical characters into Notepad and then using a hex editor or whatever, tell me what the ASCII codes are for "" and "". Yes, I'm using a Spanish keyboard --- this is not my machine.

BTW, thanks for the interesting additional information.
*****
Logged
Pages: [1] 2 3 Print 
Qbasicnews.com  |  QBasic  |  QB Discussion & Programming Help  |  Topic: Please provide ASCII codes for Spanish characters. « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines
SMF Theme © Gaia
Valid XHTML 1.0! Valid CSS!