hola

On Mon, 2010-10-04 at 13:34 -0700, Todd Ross wrote:
> In order to convert _to_ EBCDIC, I need to know what I'm converting _from_.  
> And 
> therein lies my impossible problem; how does one determine the encoding of a 
> file upload?  The browser does provide some information in the form of the 
> file 
> name and the mime type but neither would indicate whether the (text/plain) 
> file 
> was encoded with ISO-8859-1 or UTF-8 or something else entirely.

i think you have to do this programmatically by examining the characters
in the file. there may be libraries to do this already somewhere, but i
have exerted no effort to find them.

as you mention, you can't count on users, and they can [and will] upload
just about anything.

good luck!

-- 
\js

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to