Author |
Message
|
ein |
Posted: Fri Mar 19, 2010 4:01 am Post subject: How we can handle special character. |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
Hello Guys
Can any one suggest me , what is the CCSID and encoding for the cahracter" å"
Code is
Declare msg BLOB = ASBITSTREAM(InputputRoot.XMLNS);
The input data has some special character like "Ã¥" , So it getting failed.
throws xml parsing error. Can any suggest me how this situvation can handle it. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 19, 2010 4:25 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi,
It would be a bad idea to just give you the answer. You need to get the skills to sort out this type of problem for yourself.
Unicode defines thousands of 'code points' ( characters ). Is there exactly one CCSID/encoding for each Unicode character?
You might find Wikipedia helpful. Search for 'Unicode' or 'code page'. |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun Mar 21, 2010 4:37 pm Post subject: Re: How can we handle special character? |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
ein wrote: |
what is the CCSID and encoding for the character "Ã¥"? |
kimbert wrote: |
It would be a bad idea to just give you the answer. |
It would even be impossible to answer the question, at least as asked.
The ccsid (CodedCharSetId) field maps a sequence of (logical) characters to a sequence of (physical) bytes, (and vice-versa). It's impossible to guess the ccsid without both the characters and the bytes.
The sender provides the bytes. The sender also provides the ccsid. That way, the receiver doesn't have to guess.
The Encoding field is irrelevant for character data; it describes numeric data (binary integers, packed-decimal integers, and floating-point numbers).
ein wrote: |
Code: |
Declare msg BLOB = ASBITSTREAM(InputputRoot.XMLNS); |
|
It's better to copy-paste when posting, to avoid spelling and other transcription errors.
It's usually better to use XMLNSC over XMLNS.
The ASBITSTREAM() function may require additional clauses. Consult the documentation for more details. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 22, 2010 2:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
It would even be impossible to answer the question, at least as asked. |
Yes. I was hoping that ein would work that out while attempting to answer my other question  |
|
Back to top |
|
 |
AndreasMartens |
Posted: Mon Mar 22, 2010 5:08 am Post subject: Lots of things to learn |
|
|
 Acolyte
Joined: 30 Jan 2006 Posts: 65 Location: Hursley, UK
|
You're entering a field mired with pain and suffering, here are a few tips to assist your reading as Tim has suggested:
1. The broker will always use Unicode to represent strings, Unicode is the holy grail of character sets as it can represent any character (within reason), I'd suggest you read up on it first (and learn the difference between "Unicode", and a "Unicode Transformation Format" as many people confuse them)
2. The most common codepage problem is when you are trying to convert to a codepage that can't hold the characters you're asking it to, I'd suggest you don't waste time trying to figure out which codepage they belong to (æ, ø, and å would generally be regarded as "at home" in latin 1) as they'll belong to several, and fixing this problem will get you in trouble when another trouble character comes along (for instance €, prompting you to move to latin 9). Just go straight to utf-8.
When I take over the planet the first thing I'll do is enforce Unicode. Then I'll force everyone to switch to UTC time, closely followed by a rebellion and my assassination.
cheers,
Andreas |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 22, 2010 5:31 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
AndreasMartens wrote: |
When I take over the planet... |
Vikings. They haven't changed in the last 1000 years. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 22, 2010 5:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kimbert wrote: |
AndreasMartens wrote: |
When I take over the planet... |
Vikings. They haven't changed in the last 1000 years. |
When you've got cool hats like that, who would???
Must make the canteen at Hursley an interestingly cosmopolitan place. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 22, 2010 5:51 am Post subject: Re: Lots of things to learn |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AndreasMartens wrote: |
When I take over the planet the first thing I'll do is enforce Unicode. Then I'll force everyone to switch to UTC time, closely followed by a rebellion and my assassination. |
Don't worry - when my forces storm the palace I'll fake your death & smuggle you out the back.
Then change UTC back to GMT.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Mon Mar 22, 2010 6:42 am Post subject: Re: Lots of things to learn |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Vitor wrote: |
Then change UTC back to GMT.  |
Why stop there? Lets bring back the Babylonian counting system also. How hard can Base60 be? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 22, 2010 6:59 am Post subject: Re: Lots of things to learn |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WMBDEV1 wrote: |
Vitor wrote: |
Then change UTC back to GMT.  |
Why stop there? Lets bring back the Babylonian counting system also. How hard can Base60 be? |
I was wondering who'd fall for my cunning British joke....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Mon Mar 22, 2010 7:07 am Post subject: Re: Lots of things to learn |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Vitor wrote: |
WMBDEV1 wrote: |
Vitor wrote: |
Then change UTC back to GMT.  |
Why stop there? Lets bring back the Babylonian counting system also. How hard can Base60 be? |
I was wondering who'd fall for my cunning British joke....  |
I took it to mean that we made everyone use GMT, regardless of where they were in the world in some colonial superpower attempt at restoring our empire and to make things nice and simple. Those were the days...... |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 22, 2010 7:15 am Post subject: Re: Lots of things to learn |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WMBDEV1 wrote: |
I took it to mean that we made everyone use GMT, regardless of where they were in the world in some colonial superpower attempt at restoring our empire and to make things nice and simple. Those were the days...... |
And you're quite right that (in my new world order after I've replaced the Viking) I shall use GMT to reestablish the glory days of the Empire.
The joke is that (give or take a few seconds) UTC = GMT.
http://en.wikipedia.org/wiki/Coordinated_Universal_Time _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
AndreasMartens |
Posted: Mon Mar 22, 2010 7:49 am Post subject: Think of the children! |
|
|
 Acolyte
Joined: 30 Jan 2006 Posts: 65 Location: Hursley, UK
|
But a few million years in the future GMT would be waaay off the correct time since it hasn't been observing leap seconds.
Britain would also be in trouble once I eradicate the Imperial numbering system and establish driving on the right-hand side of the road. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 22, 2010 8:09 am Post subject: Re: Think of the children! |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AndreasMartens wrote: |
But a few million years in the future GMT would be waaay off the correct time since it hasn't been observing leap seconds. |
At which point you'll need to patch all the OS-COBOL programs which are still running. Or use the warp engines to spin the planet faster.
In practice we'll just keep using GMT and get out of bed while it's still dark.
AndreasMartens wrote: |
Britain would also be in trouble once I eradicate the Imperial numbering system and establish driving on the right-hand side of the road. |
Or as we say in British, the wrong side of the road  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 22, 2010 8:15 am Post subject: Re: Think of the children! |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Vitor wrote: |
AndreasMartens wrote: |
Britain would also be in trouble once I eradicate the Imperial numbering system and establish driving on the right-hand side of the road. |
Or as we say in British, the wrong side of the road  |
The first victory is ours. You now buy your petrol in Liters...
Imperial Gallon bye bye...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|