Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370866

Summary: Character escaping may fail when encoding is set to US-ASCII
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan, eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Core - Fix
none
MOXy - Fix
none
MOXy - Test Cases
none
MOXy - Test Cases
none
MOXy - Test Cases
none
Core - Fix
none
MOXy - Fix
none
MOXy - Test Cases (2.3.3)
none
Core - Fix (2.3.3)
none
MOXy - Fix (2.3.3)
none
Core - Fix (Part 2) none

Description Rick Barkhouse CLA 2012-02-07 13:29:10 EST
EclipseLink fails to correctly escape certain characters (presumably past a certain range) when encoding is set to US-ASCII, and therefore differs from the Sun JAXB implementation.

Example:

JAXBElement<String> e = objFactory.createE("G\u00F6del & his friends");

class com.sun.xml.bind.v2.runtime.JAXBContextImpl
US-ASCII
<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<e>G&#246;del &amp; his friends</e>


class org.eclipse.persistence.jaxb.JAXBContext
US-ASCII
<?xml version="1.0" encoding="US-ASCII"?>
<e>G?del &amp; his friends</e>
Comment 1 Blaise Doughan CLA 2012-03-21 16:21:11 EDT
Created attachment 213021 [details]
Core - Fix
Comment 2 Blaise Doughan CLA 2012-03-21 16:21:37 EDT
Created attachment 213022 [details]
MOXy - Fix
Comment 3 Blaise Doughan CLA 2012-03-30 11:42:14 EDT
Created attachment 213393 [details]
MOXy - Test Cases
Comment 4 Blaise Doughan CLA 2012-03-30 11:44:04 EDT
Created attachment 213394 [details]
MOXy - Test Cases
Comment 5 Blaise Doughan CLA 2012-03-30 11:45:05 EDT
Created attachment 213395 [details]
MOXy - Test Cases
Comment 6 Blaise Doughan CLA 2012-03-30 13:00:21 EDT
Created attachment 213398 [details]
Core - Fix
Comment 7 Blaise Doughan CLA 2012-03-30 13:04:43 EDT
Created attachment 213400 [details]
MOXy - Fix
Comment 8 Blaise Doughan CLA 2012-03-30 14:10:26 EDT
Created attachment 213403 [details]
MOXy - Test Cases (2.3.3)
Comment 9 Blaise Doughan CLA 2012-03-30 14:10:41 EDT
Created attachment 213404 [details]
Core - Fix (2.3.3)
Comment 10 Blaise Doughan CLA 2012-03-30 14:10:59 EDT
Created attachment 213405 [details]
MOXy - Fix (2.3.3)
Comment 11 Blaise Doughan CLA 2012-03-30 14:24:18 EDT
Fix checked into trunk at rev:  11074
Fix checked into 2.3.3 at rev:  11075

Code reviewed by:  Denise Smith

Fix Details:
Check to see if the character can be handled in the charset, if not escape it.
Comment 12 Blaise Doughan CLA 2012-04-02 11:02:43 EDT
Reopeining due to NPE occuring in the SDO tests.
Comment 13 Blaise Doughan CLA 2012-04-02 11:04:23 EDT
Created attachment 213456 [details]
Core - Fix (Part 2)

To address the NPE that were occurring in the SDO test cases.
Comment 14 Blaise Doughan CLA 2012-04-02 11:10:06 EDT
Fix checked into trunk at rev:  11084
Fix checked into 2.3.3 at rev:  11085
Comment 15 Eclipse Webmaster CLA 2022-06-09 10:15:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 16 Eclipse Webmaster CLA 2022-06-09 10:32:49 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink