I am trying to write a for loop that will print all the ISO-Latin characters
to a database. However: I am not sure exactly how to go about printing the
ISO-Latin character set. Would anyone be able to give me some pointers? I
think I have to use Encoding eISOLatin = Encoding.GetEncoding(28591); but
after this: I am a bit lost.
Thanks
Andy 9 6133
Andy <An**@discussions.microsoft.com> wrote: I am trying to write a for loop that will print all the ISO-Latin characters to a database. However: I am not sure exactly how to go about printing the ISO-Latin character set. Would anyone be able to give me some pointers? I think I have to use Encoding eISOLatin = Encoding.GetEncoding(28591); but after this: I am a bit lost.
It would help if you'd say exactly what you mean by "printing" to a
database.
I suspect you don't need an encoding at all though - if your database
understands Unicode appropriately, you should just be able to write all
the characters to the database as strings. The exact range of
ISO-Latin-1 is somewhat interesting - the Unicode standard implies that
it's Unicode values 0-255, but I believe it's *actually* 32-127 and
160-255.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jon:
I have been tasked with writing a small app to print all ISO-Latin
characters into an AS/400 table, so that we are able to assertain which come
through correctly and which ones we can support from .Net through to the
AS/400. I was told that we did'nt want ANSCII characters, as they would be
truncated.
I am lost on how to exactly print the ISO-Latin values so that when inserted
into a table on our AS/400, we can determine which are supportable.
I hope this helps further explain the issue.
Thanks
Andy
"Jon Skeet [C# MVP]" wrote: Andy <An**@discussions.microsoft.com> wrote: I am trying to write a for loop that will print all the ISO-Latin characters to a database. However: I am not sure exactly how to go about printing the ISO-Latin character set. Would anyone be able to give me some pointers? I think I have to use Encoding eISOLatin = Encoding.GetEncoding(28591); but after this: I am a bit lost.
It would help if you'd say exactly what you mean by "printing" to a database.
I suspect you don't need an encoding at all though - if your database understands Unicode appropriately, you should just be able to write all the characters to the database as strings. The exact range of ISO-Latin-1 is somewhat interesting - the Unicode standard implies that it's Unicode values 0-255, but I believe it's *actually* 32-127 and 160-255.
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
Andy <An**@discussions.microsoft.com> wrote: I have been tasked with writing a small app to print all ISO-Latin characters into an AS/400 table, so that we are able to assertain which come through correctly and which ones we can support from .Net through to the AS/400. I was told that we did'nt want ANSCII characters, as they would be truncated.
What do you mean by "ANSCII"? Do you mean ASCII, or ANSI?
I am lost on how to exactly print the ISO-Latin values so that when inserted into a table on our AS/400, we can determine which are supportable.
I still don't know what you mean by "printing" a character into a
table. Do you just mean inserting a string value into a table? If so,
just create a parameterised SQL statement which inserts the parameter
into the table, and call it repeatedly, once per character in the
ranges 32-127 and 160-255. (Alternatively, call it once with a string
with all those characters in - I think the former would make it easier
to work out what doesn't work though, especially if you include a
second parameter which is an integer, the Unicode value you're
inserting.)
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jon:
Thanks again for the response, but I am still a little lost. I am not sure
how to format the SQL string for insertion into the table. I have tried
various scenarios, and nothing has seemed to work.
Here is my code, perhaps that will help:
Encoding eISOLatin = Encoding.GetEncoding(28591);
for(int i = 160; i <= 255; i++)
{
sSQL = "INSERT INTO tEncoding(s_Encoding) VALUES ('')";
oCommand.CommandText = sSQL;
oCommand.ExecuteNonQuery();
}
Thanks
Andy
"Jon Skeet [C# MVP]" wrote: Andy <An**@discussions.microsoft.com> wrote: I have been tasked with writing a small app to print all ISO-Latin characters into an AS/400 table, so that we are able to assertain which come through correctly and which ones we can support from .Net through to the AS/400. I was told that we did'nt want ANSCII characters, as they would be truncated.
What do you mean by "ANSCII"? Do you mean ASCII, or ANSI?
I am lost on how to exactly print the ISO-Latin values so that when inserted into a table on our AS/400, we can determine which are supportable.
I still don't know what you mean by "printing" a character into a table. Do you just mean inserting a string value into a table? If so, just create a parameterised SQL statement which inserts the parameter into the table, and call it repeatedly, once per character in the ranges 32-127 and 160-255. (Alternatively, call it once with a string with all those characters in - I think the former would make it easier to work out what doesn't work though, especially if you include a second parameter which is an integer, the Unicode value you're inserting.)
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
Andy <An**@discussions.microsoft.com> wrote: Thanks again for the response, but I am still a little lost. I am not sure how to format the SQL string for insertion into the table. I have tried various scenarios, and nothing has seemed to work.
Here is my code, perhaps that will help:
Encoding eISOLatin = Encoding.GetEncoding(28591); for(int i = 160; i <= 255; i++) { sSQL = "INSERT INTO tEncoding(s_Encoding) VALUES ('')"; oCommand.CommandText = sSQL; oCommand.ExecuteNonQuery(); }
Okay, well as I said, you don't need to use an encoding.
You should change your SQL so that it has a parameter (the exact
details of which will depend on the database driver) and then set the
parameter to a string value:
string characterAsString = Convert.ToString((char)i);
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Andy.
Jon gave the solution. But my question is;
- Why would you want do this?
I struggled for minutes now (ages for me), and I can't think of a single
application or feature that would want a couple of chars in a table. Do tell
us... please...
Curious
- Michael S
Mike:
It is a long drawnout process: but we take orders online. We have
international orders that need special characters, and some logos use special
characters that MUST be on the item ordered. In order to get to our
printing system: the orders must go through various steps and applications
(some very poor third party applications). We want to run a test through the
entire process all the way to our AS/400 so that we can advertsie which
special characters can be processed from start to finish.
I have been charged with doing this test.
I hope this answers your question.
"Michael S" wrote: Andy.
Jon gave the solution. But my question is;
- Why would you want do this?
I struggled for minutes now (ages for me), and I can't think of a single application or feature that would want a couple of chars in a table. Do tell us... please...
Curious - Michael S
Jon:
Thanks for the help and patience. I got way lost when my boss said it had
to be the ISO-Latin set. Thanks for all the help.
Andy
"Jon Skeet [C# MVP]" wrote: Andy <An**@discussions.microsoft.com> wrote: Thanks again for the response, but I am still a little lost. I am not sure how to format the SQL string for insertion into the table. I have tried various scenarios, and nothing has seemed to work.
Here is my code, perhaps that will help:
Encoding eISOLatin = Encoding.GetEncoding(28591); for(int i = 160; i <= 255; i++) { sSQL = "INSERT INTO tEncoding(s_Encoding) VALUES ('')"; oCommand.CommandText = sSQL; oCommand.ExecuteNonQuery(); }
Okay, well as I said, you don't need to use an encoding.
You should change your SQL so that it has a parameter (the exact details of which will depend on the database driver) and then set the parameter to a string value:
string characterAsString = Convert.ToString((char)i);
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
"Andy" <An**@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com... I have been charged with doing this test.
We feel sorry for you. I hope you get paid a lot for doing this.
If not, your manager hates you and it's time to look for better job. =)
Happy Coding
- Michael S This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jrefactors |
last post by:
When people say C programming language, they mean ISO C89? The latest C
is ISO C99, but
I heard this is not commonly used. What's the differences between ISO
C89 and ISO C99?
Please advise....
|
by: Sensei |
last post by:
Hi!
I'm looking for useful libraries that are strictly ISO C. Any kind of
library, from lists, stacks, to trees, searching tools, sorting
tools... really *any* kind.
Do you have any idea? :)...
|
by: pemo |
last post by:
ISO C does not allow extra ';' outside of a function
int n;;
int main(void)
{
....
}
Anyone care to enlighten me as to why ISO C does not allow this, but
|
by: John Daly |
last post by:
Hope this is the right place to post this. I recently downloaded iso disc
imsges, however my new pc did not come with burning software, and i can not
find my old discs. I tried to use the Burning...
|
by: Alok |
last post by:
Hi,
I want to purchase the ISO C++ standard ISO/IEC 14882:2003
specification for reference. The ANSI store sells the PDF or CD-ROM of
the document for $30...
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
|
by: danikar |
last post by:
Is there a way to open a file that is inside of an ISO in python?
Say I have an ISO file, danikars.iso and on the iso there is a file
called information.txt
I want to be able to do something...
|
by: ManicQin |
last post by:
Hi,
I was about to buy the Standard but then I found this link
http://www.usatlas.bnl.gov/~dladams/cpp/INCITS+ISO+IEC+14882-2003.pdf
Hmmmm... ... The link seems legit so ... what gives?
...
|
by: scotter86 |
last post by:
Hi everyone, I'm trying to "burn","mount" what ever you want to call it, an .iso file to a hard disk partition. What I'm trying to do is get this iso on a partition and boot it much like I would a...
|
by: tvnaidu |
last post by:
I am using Three pthread functions below, I got ISO error, then I declared int variable called val123, then I assigned, but still I am getting error, any idea?. also I included pthread.h. compiling...
|
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,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |