• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: String Encodings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String Encodings


  • Subject: Re: String Encodings
  • From: Jim Kuo <email@hidden>
  • Date: Tue, 23 Aug 2005 22:11:57 +0100

Hi
You don't need to do all that , just assign your string normally, eg.

    public String readThis() {
        return "non-ASCII string: 你好";
    }

and set your active target to Application Server, then Project->Edit Active Target "Application Server",
click on Java Compiler Settings, make sure the Source file encoding drop down is set to Unicode (UTF-8), recompile and run.


Jim

On 23 Aug 2005, at 22:04, Paolo Sommaruga wrote:

Hi Daniel,

try with

 public String readThis() {

return new String("non-ASCII string: Æúäñ".getBytes(), "UTF-8");

   }


Paolo Sommaruga


Il giorno 23/ago/05, alle ore 20:59, Daniel Eggert ha scritto:


Hi,

In my HTML header I've set the string encoding to UTF-8, and also my database runs UTF-8, but Java does not use UTF-8.

As long as I only push data from the database to my web-page or the other way, things look fine with non-ASCII, but if I write code like

    public String readThis() {
        return "non-ASCII string: Æúäñ";
    }

The thing looks wrong, since I'm pushing Java-encoded (UTF-16, I assume) into a HTML-page that the browser thinkgs is UTF-8.

Have I set something up in a wrong way? How are other people working around this problem?

BTW: The file encoding of my source files is UTF-8.

/Daniel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40jpaso.com


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40yahoo.co.uk


This email sent to email@hidden




___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: String Encodings
      • From: Daniel Eggert <email@hidden>
References: 
 >String Encodings (From: Daniel Eggert <email@hidden>)
 >Re: String Encodings (From: Paolo Sommaruga <email@hidden>)

  • Prev by Date: Re: String Encodings
  • Next by Date: Re: WOContext->completeURLWithRequestHandlerKey's aRequestHandlerPath
  • Previous by thread: Re: String Encodings
  • Next by thread: Re: String Encodings
  • Index(es):
    • Date
    • Thread