You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Adam Hardy <ah...@cyberspaceroad.com> on 2003/12/18 02:34:51 UTC

xml escaping characters for database password

Hi,
I'm using mysql via JDBC and I need to encode a password with 
non-alphabet characters in it like % in my server.xml.

Do I use a URL encoding for this or an XML encoding?

Also while I'm on the subject, do I have to encode or escape a 
double-quote in an xml attribute:

<mynode attr1="blahblah\"blah\"blah"/>

or is there some other encoding I should use?

Thanks
Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: xml escaping characters for database password

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 12/18/2003 02:54 AM&nbsp;Justin Ruthenbeck wrote:
> At 05:34 PM 12/17/2003, you wrote:
> 
>> Hi,
>> I'm using mysql via JDBC and I need to encode a password with 
>> non-alphabet characters in it like % in my server.xml.
>>
>> Do I use a URL encoding for this or an XML encoding?
> 
> 
> I don't know for sure as I haven't used mysql specifically, but if the 
> password will be read by an xml parser, then you'll want to xml encode 
> it.  If the password is part of a URI that is specified in an XML, then 
> you'll want to URL-encode the character(s) and XML encode any 
> problematic characters from that output.
> 
>> Also while I'm on the subject, do I have to encode or escape a 
>> double-quote in an xml attribute:
>>
>> <mynode attr1="blahblah\"blah\"blah"/>
> 
> 
> &quot; in this case.  This can depend on your parser (or at least it has 
> in older parsers).
> 
>> Thanks
>> Adam
> 
> 
> justin

Thanks v. much

Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: xml escaping characters for database password

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
At 05:34 PM 12/17/2003, you wrote:
>Hi,
>I'm using mysql via JDBC and I need to encode a password with 
>non-alphabet characters in it like % in my server.xml.
>
>Do I use a URL encoding for this or an XML encoding?

I don't know for sure as I haven't used mysql specifically, but if the 
password will be read by an xml parser, then you'll want to xml encode 
it.  If the password is part of a URI that is specified in an XML, then 
you'll want to URL-encode the character(s) and XML encode any problematic 
characters from that output.

>Also while I'm on the subject, do I have to encode or escape a 
>double-quote in an xml attribute:
>
><mynode attr1="blahblah\"blah\"blah"/>

&quot; in this case.  This can depend on your parser (or at least it has 
in older parsers).

>Thanks
>Adam

justin 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org