FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Integration
(Moderators: fry, REAS)
   character encoding of pde-files?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: character encoding of pde-files?  (Read 520 times)
fjen

WWW
character encoding of pde-files?
« on: Sep 29th, 2004, 4:55pm »

since i'm still working on the processing-code-colorizer i was wondering what kind of character encoding the pde-files use?
in the "manual" it says depending on the way you write the files to disk in java they are either read/stored in the default encoding of your machine (readers/writers without specifying an encoding) or are blind (streams) ...
 
code-colorizer:
http://www.florianjenett.de/pcc/
 
/F
 
fry


WWW
Re: character encoding of pde-files?
« Reply #1 on: Sep 29th, 2004, 7:29pm »

they're written using a writer, so the default encoding of your machine.
 
however we haven't tested this extensively, so i wouldn't be surprised if there are goofs and would be curious to hear if there were.
 
fjen

WWW
Re: character encoding of pde-files?
« Reply #2 on: Sep 29th, 2004, 10:43pm »

aha. i'm happy to check for pde-file-character-hick-ups on my machine ... never have seen one before though.
 
i guess using default encoding is due to compatibility on the original machine, although in case of open-source and code-exchange it would be great to have it all in one encoding .. or?
 
my problem with the code coloring is that i can't convert the characters to the proper html-entities without knowing what they've been encoded with in the first place ... any ideas?
 
/F
 
cello

marcello3d WWW
Re: character encoding of pde-files?
« Reply #3 on: Sep 29th, 2004, 11:15pm »

utf-8?
 
fjen

WWW
Re: character encoding of pde-files?
« Reply #4 on: Sep 29th, 2004, 11:31pm »

utf-8, yes ... but can't convert to it without knowing what the pde-file was encoded with in the first place ..
 
cello

marcello3d WWW
Re: character encoding of pde-files?
« Reply #5 on: Sep 30th, 2004, 12:16am »

Well, I was merely suggesting a standard for processing in general.  Covers all character encodings...
 
For the code colorizer, I suggest simply having it as a parameter to the colorizing function so the user can encode with whatever encoding they like.  On the site you could do a dropdown list (or some kind of autodetect that grabs the character encoding from the server... not entirely sure how you'd do this in php without manually reading the http stream via sockets).  I'm not sure how safe it is to assume most sources will be ISO-8859-15 or not...
 
What character encoding do the readStrings and similar functions use inside Processing?  That should determine something.
 
Marcello
 
fjen

WWW
Re: character encoding of pde-files?
« Reply #6 on: Sep 30th, 2004, 1:19am »

yes, i agree an the standard, got that ...
 
i thought about having it as an option as well, but most (ok, many) people don't know which encoding they're on .. how will they be able to set it, not knowing what they want?
and still then the problem remains: what was the original pde encoded in in the first place (not having a standard to date)? doing a guess on the stream won't help since the server might be wrong as well (german website on american server i.e.).
 
i suggest to have the pcc use utf-8 as well .. as you said, covers all.
 
soo .. i vote for both being utf-8.
 
/F
 
fry


WWW
Re: character encoding of pde-files?
« Reply #7 on: Sep 30th, 2004, 1:38am »

actually, you're generally gonna want to stick with just plain ascii for all code except for perhaps comments. java compilers aren't guaranteed to work with non-ascii chars (unless they're in comments) even though it might be ok sometimes.. this is what the jdk's native2ascii tool handles, if you want to use non-ascii stuff.
 
fjen

WWW
Re: character encoding of pde-files?
« Reply #8 on: Sep 30th, 2004, 2:02am »

aha. ok.
 
the reason i started all this is people using i.e. german umlaute in strings or comments .. as far as i understood from the sun site is that java chars represent unicode characters. so i guess the compiler won't complain about that. code sure is better to be ascii .. i see that.
 
http://java.sun.com/docs/books/tutorial/i18n/text/convertintro.html
 
public claß SüperDüperSpaß { ... } // who would want that?
 
/F
 
Pages: 1 

« Previous topic | Next topic »