473,503 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convertabilty String to extended ASCII

dzenanz
45 New Member
If someone comes by the same problem as me (converting string to 8-bit ascii codes), here is the solution:

Expand|Select|Wrap|Line Numbers
  1. String s="ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ";
  2. byte ascii[]=s.getBytes("Cp437");
Cp437 can be replaced by IBM437, but not by Windows-1252, Latin1, US-ASCII (this is 7-bit ascii) and ISO-8859-1.

My problem was that I was trying to use "ISO-8859-1" (being nice standards-compliant guy), "ISO_8859_1", "8859_1" and such, instead going immediately for the code page 437 (DOS-US, OEM-DOS).

I hope this will help someone.
Apr 4 '08 #1
1 7275
BigDaddyLH
1,216 Recognized Expert Top Contributor
If someone comes by the same problem as me (converting string to 8-bit ascii codes), here is the solution:

Expand|Select|Wrap|Line Numbers
  1. String s="ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ";
  2. byte ascii[]=s.getBytes("Cp437");
Cp437 can be replaced by IBM437, but not by Windows-1252, Latin1, US-ASCII (this is 7-bit ascii) and ISO-8859-1.

My problem was that I was trying to use "ISO-8859-1" (being nice standards-compliant guy), "ISO_8859_1", "8859_1" and such, instead going immediately for the code page 437 (DOS-US, OEM-DOS).

I hope this will help someone.
I guess it all hinges on how one defines "extended ASCII".
Apr 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
505
by: john | last post by:
On my form i have a message box called txtItemDesc that displays the french phrase qualité Père Noël. Now then when i run this code on that text box: Dim chrArr() As Char chrArr =...
18
5587
by: Zygmunt Krynicki | last post by:
Hello I've browsed the FAQ but apparently it lacks any questions concenring wide character strings. I'd like to calculate the length of a multibyte string without converting the whole string. ...
11
17385
by: Kai Bohli | last post by:
Hi all ! I need to translate a string to Ascii and return a string again. The code below dosen't work for Ascii (Superset) codes above 127. Any help are greatly appreciated. protected...
3
276668
by: pkumar | last post by:
How to convert this byte array to string byte b=new byte; Is there any function or I need read one by one and build the string thanks
18
34069
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
3
5135
by: quat | last post by:
Hi, I have a char* string where I assigned a string literal with the British pound symbol, which is included in the extended ASCII, at least on my OS. However, when I cout the string, I get a...
18
9019
by: John | last post by:
Hi, I'm a beginner is using C# and .net. I have big legacy files that stores various values (ints, bytes, strings) and want to read them into a C# programme so that I can store them in a...
6
2154
by: AG | last post by:
I have a file that contains ASCII and Extended ASCII characters. I need to get the file contents into a string, but the Extended ASCII characters (dec 128 and 129) are being changed to dec 63. I...
13
48022
by: ramif | last post by:
Is there a way to print extended ASCII in C?? I tried to code something, but it only displays strange symbols. here is my code: main() { char chr = 177; //stores the extended ASCII...
0
7086
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
7280
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
7330
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...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.