• 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: [OT] File Encoding question again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] File Encoding question again


  • Subject: Re: [OT] File Encoding question again
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 5 Dec 2005 11:23:47 -0800


On Dec 4, 2005, at 10:22 AM, Ute Hoffmann wrote:

Hallo,
sorry, this is more a Java than a WebObjects Question...

Suppose a user loads up a file with data (cvs) which will be read in by WebObjects and then parsed and sent to the database... How can I find out which the encoding of the file provided by the user is?

Is there a test I can run on the string (or the file) which gives back the current encoding? I could not find it in Javadoc. I can change the encoding but I need to know which encoding the file came with, as far as I understand it.

Is there a way to know? When the user exports from excel on a windows machine he neither knows nor cares (nor could I find a way to tell excel which encoding to use). But in Germany we have all those Umlauts .... so we need to be careful with the encoding.

This is not really (at all) my area of expertise, but I don't think it is possible to know by examining the file. AFAIK, all the 8 bit encodings (Mac Roman whatever, UTF-88, Win Latin, Western Latin etc), are too similar to correctly guess at.


You can set the encoding the form is supposed to submit in and then set that same encoding as the default for the request before getting the form values (UTF-8 is recommended). In theory, the browser should take care of any needed re-encoding issues but I don't recall doing any tests of this.

Chuck

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro


Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________ 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: [OT] File Encoding question again
      • From: Ondra Cada <email@hidden>
References: 
 >[OT] File Encoding question again (From: Ute Hoffmann <email@hidden>)

  • Prev by Date: Re: Locking/Unlocking-Problem with EditingContext
  • Next by Date: Re: [OT] File Encoding question again
  • Previous by thread: [OT] File Encoding question again
  • Next by thread: Re: [OT] File Encoding question again
  • Index(es):
    • Date
    • Thread