473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ansi to oem conversion with borland C3.1

Hi,

I'm trying to read the belgium eid card which gives out utf8, i can
convert it to ansi but now i have the problem of converting the special
chart to oem.
utf8 to ansi
for(x=0;x<lengte;x++){
if((SubPart[x]&0x80)==0) printf("%c",SubPart[x]);
else{
unsigned char y;
y=((SubPart[x]&0x1F)<<6)|SubPart[x+1]&0x3F;
x++;
printf("%c",y);
printf("|%d|",y);
}
}
printf("\n");

Now the problem is that "+®" (é) is displayed as Ú so i need to
convert it back to é.
In but there is no ansi to oem convertor is borland C 3.1.

Regards
Laery

Feb 17 '06 #1
3 3403
Hi,

I found the answer using pc8 code table.

unsigned int oem[257]={
0, 1, 2, 3, 4, 5, 6, 7, // # 0 - 7
8, 9, 10, 11, 12, 13, 14, 15, // # 8 - 15
16, 17, 18, 19, 182, 186, 22, 23, // # 16 - 23
24, 25, 26, 27, 28, 29, 30, 31, // # 24 - 31
32, 33, 34, 35, 36, 37, 38, 39, // # 32 - 39
40, 41, 42, 43, 44, 45, 46, 47, // # 40 - 47
48, 49, 50, 51, 52, 53, 54, 55, // # 48 - 55
56, 57, 58, 59, 60, 61, 62, 63, // # 56 - 63
64, 65, 66, 67, 68, 69, 70, 71, // # 64 - 71
72, 73, 74, 75, 76, 77, 78, 79, // # 72 - 79
80, 81, 82, 83, 84, 85, 86, 87, // # 80 - 87
88, 89, 90, 91, 92, 93, 94, 95, // # 88 - 95
96, 97, 98, 99, 100, 101, 102, 103, // # 96 - 103
104, 105, 106, 107, 108, 109, 110, 111, // # 104 - 111
112, 113, 114, 115, 116, 117, 118, 119, // # 112 - 119
120, 121, 122, 123, 124, 125, 126, 127, // # 120 - 127
199, 252, 233, 226, 228, 224, 229, 231, // # 128 - 135
234, 235, 232, 239, 238, 236, 196, 197, // # 136 - 143
201, 181, 198, 244, 247, 242, 251, 249, // # 144 - 151
223, 214, 220, 243, 183, 209, 158, 159, // # 152 - 159
255, 173, 155, 156, 177, 157, 188, 21, // # 160 - 167
191, 169, 166, 174, 170, 237, 189, 187, // # 168 - 175
248, 241, 253, 179, 180, 230, 20, 250, // # 176 - 183
184, 185, 167, 175, 172, 171, 190, 168, // # 184 - 191
192, 193, 194, 195, 142, 143, 146, 128, // # 192 - 199
200, 144, 202, 203, 204, 205, 206, 207, // # 200 - 207
208, 165, 210, 211, 212, 213, 153, 215, // # 208 - 215
216, 217, 218, 219, 154, 221, 222, 225, // # 216 - 223
133, 160, 131, 227, 132, 134, 145, 135, // # 224 - 231
138, 130, 136, 137, 141, 161, 140, 139, // # 232 - 239
240, 164, 149, 162, 147, 245, 148, 246, // # 240 - 247
176, 151, 163, 150, 129, 178, 254, 152 // # 248 - 255
}
if(y>127){
printf("!%c!",oem[y]);
}

Regards
Laery
th******@hotpop.com schreef:
Hi,

I'm trying to read the belgium eid card which gives out utf8, i can
convert it to ansi but now i have the problem of converting the special
chart to oem.
utf8 to ansi
for(x=0;x<lengte;x++){
if((SubPart[x]&0x80)==0) printf("%c",SubPart[x]);
else{
unsigned char y;
y=((SubPart[x]&0x1F)<<6)|SubPart[x+1]&0x3F;
x++;
printf("%c",y);
printf("|%d|",y);
}
}
printf("\n");

Now the problem is that "+®" (é) is displayed as Ú so i need to
convert it back to é.
In but there is no ansi to oem convertor is borland C 3.1.

Regards
Laery


Feb 17 '06 #2
Hi,

I found the answer using pc8 code table.

unsigned int oem[257]={
0, 1, 2, 3, 4, 5, 6, 7, // # 0 - 7
8, 9, 10, 11, 12, 13, 14, 15, // # 8 - 15
16, 17, 18, 19, 182, 186, 22, 23, // # 16 - 23
24, 25, 26, 27, 28, 29, 30, 31, // # 24 - 31
32, 33, 34, 35, 36, 37, 38, 39, // # 32 - 39
40, 41, 42, 43, 44, 45, 46, 47, // # 40 - 47
48, 49, 50, 51, 52, 53, 54, 55, // # 48 - 55
56, 57, 58, 59, 60, 61, 62, 63, // # 56 - 63
64, 65, 66, 67, 68, 69, 70, 71, // # 64 - 71
72, 73, 74, 75, 76, 77, 78, 79, // # 72 - 79
80, 81, 82, 83, 84, 85, 86, 87, // # 80 - 87
88, 89, 90, 91, 92, 93, 94, 95, // # 88 - 95
96, 97, 98, 99, 100, 101, 102, 103, // # 96 - 103
104, 105, 106, 107, 108, 109, 110, 111, // # 104 - 111
112, 113, 114, 115, 116, 117, 118, 119, // # 112 - 119
120, 121, 122, 123, 124, 125, 126, 127, // # 120 - 127
199, 252, 233, 226, 228, 224, 229, 231, // # 128 - 135
234, 235, 232, 239, 238, 236, 196, 197, // # 136 - 143
201, 181, 198, 244, 247, 242, 251, 249, // # 144 - 151
223, 214, 220, 243, 183, 209, 158, 159, // # 152 - 159
255, 173, 155, 156, 177, 157, 188, 21, // # 160 - 167
191, 169, 166, 174, 170, 237, 189, 187, // # 168 - 175
248, 241, 253, 179, 180, 230, 20, 250, // # 176 - 183
184, 185, 167, 175, 172, 171, 190, 168, // # 184 - 191
192, 193, 194, 195, 142, 143, 146, 128, // # 192 - 199
200, 144, 202, 203, 204, 205, 206, 207, // # 200 - 207
208, 165, 210, 211, 212, 213, 153, 215, // # 208 - 215
216, 217, 218, 219, 154, 221, 222, 225, // # 216 - 223
133, 160, 131, 227, 132, 134, 145, 135, // # 224 - 231
138, 130, 136, 137, 141, 161, 140, 139, // # 232 - 239
240, 164, 149, 162, 147, 245, 148, 246, // # 240 - 247
176, 151, 163, 150, 129, 178, 254, 152 // # 248 - 255
}
if(y>127){
printf("!%c!",oem[y]);
}

Regards
Laery
th******@hotpop.com schreef:
Hi,

I'm trying to read the belgium eid card which gives out utf8, i can
convert it to ansi but now i have the problem of converting the special
chart to oem.
utf8 to ansi
for(x=0;x<lengte;x++){
if((SubPart[x]&0x80)==0) printf("%c",SubPart[x]);
else{
unsigned char y;
y=((SubPart[x]&0x1F)<<6)|SubPart[x+1]&0x3F;
x++;
printf("%c",y);
printf("|%d|",y);
}
}
printf("\n");

Now the problem is that "+®" (é) is displayed as Ú so i need to
convert it back to é.
In but there is no ansi to oem convertor is borland C 3.1.

Regards
Laery


Feb 17 '06 #3
On 17 Feb 2006 02:59:01 -0800, "th******@hotpop.com"
<th******@hotpop.com> wrote in comp.lang.c:
Hi,

I'm trying to read the belgium eid card which gives out utf8, i can
convert it to ansi but now i have the problem of converting the special
chart to oem.
utf8 to ansi
for(x=0;x<lengte;x++){
if((SubPart[x]&0x80)==0) printf("%c",SubPart[x]);
else{
unsigned char y;
y=((SubPart[x]&0x1F)<<6)|SubPart[x+1]&0x3F;
x++;
printf("%c",y);
printf("|%d|",y);
}
}
printf("\n");

Now the problem is that "+®" (é) is displayed as Ú so i need to
convert it back to é.
In but there is no ansi to oem convertor is borland C 3.1.

Regards
Laery


The C language knows nothing at all about "ansi" or "oem". Nor does
it know anything at all about glyphs, which is a term for the visual
appearance of a character produced by some sort of output device,
whether it be a video screen, a printer, or something else.

If you have the correct numerical value but your display devise shows
a different glyph that the one you want, you need to investigate the
use of things like font types, code pages, or locales in your compiler
and/or operating system.

You don't mention whether you are using Borland 3.1 for MS-DOS or for
Windows, perhaps your best bet would be in one of Borland's support in
the new:borland.public.* family on the server newsgroups.borland.com.

In any case, this is not a C language issue at all.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Feb 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thomas Matthews | last post by:
Hi, I'm working with Borland C++ Builder 6.2. My project uses the std::string class. However, Borland in its infinite wisdom has its own string class, AnsiString. To make my life easier, I...
7
by: | last post by:
Borland dumped all its "Borand C++ Builder" (BCB) customers. So it is our term to dump Borland (not only BCB). As a part of my attempt to dump long-loved BCB I'm trying to investigate how one can ...
3
by: Siemel Naran | last post by:
Here is a question about implicit conversion from T (&) to ptrcarray<T>. I wrote a class template <class T> struct ptrcarray { T * array; size_t size;
100
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We...
20
by: ritchie | last post by:
Hi, I am trying to clear the screen in my program. I am loking for something that will work on all compilers, especially Borland & MS Visual Studio 6. On Visual studio I used 'system("cls");'...
1
by: Philip Bondi | last post by:
Hello to all SQL Server junkies who work with non-English characters: For people running scripts from the command line using ANSI files with special characters, it is very important to use isql...
0
by: MaartenVR | last post by:
sub: MS SQL server and (missing) ANSI DATE-datatype I’m working at a company who has developed a large client/server application in Delphi 6, with Interbase as the DB-server (both Borland...
1
by: wschlanger | last post by:
Hi, the following code behaves differently for GCC/MSC and Borland C++ 5.6. The question was, what order does symbol lookup happen in? 1. declared symbols, including using'd symbols. 2....
0
by: info | last post by:
Cognaxon has released "NIST (ANSI/NIST-ITL 1-2000) library" which adds the power of NIST (ANSI/NIST-ITL 1-2000) file format to your software projects using only a few lines of code. Additionally...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.