This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes character entities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "character entities" Watch "character entities" New topic
Author

character entities

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i have a form where user writes text (in portuguese), then it is submited and finally displayed.
what happens is that if i write:
ma��s, vulc�es
what i get is:
ma����s, vulc��es
how can i solve this?
note: in my jsp i have:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and tried also strict too
i use mysql 4.1

TiA


java amateur
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i also tried several classes i googled for but they wont work properly:
i input ma��s and in database i get:maà ;§ ;à ;£s

edited: i added a space so it can be read as it is
[ November 26, 2006: Message edited by: miguel lisboa ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Are you setting the character set of the page? The Doc Type should not matter.

Eric
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
yes:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i made a significant improvement: i striped my jsp from every line of javascript/ajax... and i get nice, good, perfect inserts and outputs!
so my question now is: how to tell javascript to let me have back my nice inserts/outputs?
i can post my ajax/javascript, if needed
can someone give me any hint, please?

TiA
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
case solved!

it was indeed a javascript problem: the moment i used espace() function all turned to normal:


thanks to all who tried to help me

BTW: the link on top of this page about displaying shows a page not found...
 
 
subject: character entities
 
Similar Threads
How to parse DOCTYPE node (URGENT)
!DOCTYPE and function refreshIt() not working together
!DOCTYPE and function refreshIt() not working together
firefox doesnot display tooltip when image is disabled.
How to read XML file offline using a browser