solution

I set the page content type to "text/plain"

then on the server wrote a method to return the test to be evaluated
by the eval method on the client in javascript.
Method on the server is as follows:

public String convertToUnicode(String value){
                try{
                        if(value!=null){
                                byte[] utf8Bytes = value.getBytes("UTF8");
                                return new String(utf8Bytes);
                        }else{
                                return null;
                        }
                }catch(Exception e){
                        e.printStackTrace();
                        return value;
                }
                
        }

Thanks guys for your help

On 30/10/06, Carl Woermann <[EMAIL PROTECTED]> wrote:
>
> grasping at straws now.. does the page header contain:
>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>
> There is also UTF-16.. maybe you have to read up - although its a
> slightly heavier load (instead of the normal set ther's thousands apon
> thousands...) But I remeber that that didn't solve the problem  when I
> had my Nigerian currency problem.. I remember that the encoding
> problem wasn't consistant from Mozilla to IE.. ( worked fine in
> Mozilla - but had to specify the font specifically in IE  - not
> something you want to do when dynamically creating content..)
>
> Have you managed to get a static HTML page up that displays these
> characters correctly? - under mozilla  you can choose the page
> encoding - get the static page to display using the mozilla setting
> and work backwards form that..  Do the characters print correctly when
> output from the server console..?
>
> C.
>
>
>
> On 10/30/06, Ryan Meder <[EMAIL PROTECTED]> wrote:
> >
> > Hi i made use of URLEncoder.encode method on the server but on the
> > client my javascript is able to handle the funny characters when i
> > decode the string but still displays encoded values in the string. I
> > am thinking i need to encode to a compatible format on the server that
> > the data passed to th js method can interpret correctly.
> >
> > Does enbody know what encodeing type would be.
> >
> > I tried URLEncoder.encode (s, "UTF-8")
> >
> > thanks
> >
> > On 30/10/06, Carl Woermann <[EMAIL PROTECTED]> wrote:
> > > There are a number of ways of encoding server side - right now I can a 
> > > only
> > > think of
> > > URLEncoder.encode (String s, String enc) ... check out the javadocs..
> > >
> > >
> > > On 10/30/06, Ryan Meder <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > All that happens on the server is that i create a String JSON object
> > > > to be evaluated by the js eval method this seems to work fine expect
> > > > for the funny characters which cause problems.
> > > >
> > > > As far as i am aware i am using Verdana as one of my styles.
> > > >
> > > > On 30/10/06, Carl Woermann < [EMAIL PROTECTED]> wrote:
> > > > >  Is your text being encoded by the Server?
> > > > >
> > > > > Maybe also try to make sure the font you're using a font that supports
> > > funny
> > > > > chars - usually Verdana is the best for foreign languages..( the
> > > Nigerian
> > > > > Currency Symbol comes to mind..) - but that probably wouldn't throw a
> > > > > exception... C
> > > > >
> > > > >
> > > > > On 10/30/06, Ryan Meder < [EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > Hi
> > > > > > tried escape function, it encodes the string in a format, then i
> > > > > > decode the by making use of unexcape and still get the same error 
> > > > > > with
> > > > > > the character � throwing an exception.
> > > > > >
> > > > > > Thanks ryan
> > > > > >
> > > > > > On 30/10/06, Bertram Julius < [EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > > try escape(str)
> > > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: [email protected]
> > > > > > > [mailto:[EMAIL PROTECTED] Behalf Of Ryan Meder
> > > > > > > Sent: 30 October 2006 08:25
> > > > > > > To: [email protected]
> > > > > > > Subject: [CTJUG Forum] JavaScript Eval Method with funny 
> > > > > > > characters
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I am making use of the JavaScript eval method to evaluate my AJAX
> > > JSON
> > > > > > > objects from the server. The problem is that from the server I 
> > > > > > > have
> > > > > > > values such as i.e. � and many other funny characters. The eval
> > > method
> > > > > > > is unable to interpret these characters and throws an exception. I
> > > am
> > > > > > > sure that JavaScript must be able to resolve characters like this 
> > > > > > > as
> > > > > > > many French words contain all the funny characters and so forth.
> > > > > > >
> > > > > > > Can any body help with suggestions,
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Regards,
> > > > > > >
> > > > > > > Ryan Meder
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > This e-mail and any files transmitted with it are confidential and
> > > > > intended solely for the use of the individual or entity to which they
> > > are
> > > > > addressed.  If you have received this e-mail in error please notify
> > > NSFAS
> > > > > immediately.  Please note that any views or opinions presented in this
> > > > > e-mail are solely those of the author and do not necessarily represent
> > > those
> > > > > of the organisation.
> > > > > > >
> > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Regards,
> > > >
> > > > Ryan Meder
> > > >
> > > >
> > > > > >
> > > >
> > >
> >
> >
> > --
> > Regards,
> >
> > Ryan Meder
> >
> > >
> >
>
> >
>


-- 
Regards,

Ryan Meder

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CTJUG Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---

Reply via email to