jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra" <tobias.bocane...@day.com>
Subject Re: repository portability
Date Thu, 07 Dec 2006 10:09:22 GMT
> Tobias Bocanegra schrieb:
> >> > But I have a last question... The JSR-170 says: "The jcr:encoding
> >> > indicates the character set encoding used. If this resource does not
> >> > contains character data then this property will not be present". I'm
> >> not
> >> > sure about the meaning of this paragraph: in the test program I store
> >> > String in the nt:resource node and should have this property because of
> >> > encoding issues. But what about storing binary data like an JPG image?
> >> > It this property ignored or it shouldn't be present? Should be used
> >> only
> >> > when the jcr:mimeType property is "text/*"?
> >>
> >> The term "encoding" (as used for jcr:encoding) is meaningless for binary
> >> content. It describes how to reconstruct a sequence from characters for
> >> a sequence of bytes.
> >>
> >> So, yes, it's usually only meaningful for jcr:mimeType values matching
> >> "text/*".
> >
> > please note, that the jcr:encoding property is not used by the
> > repository itself for encoding data. it's thought as a helper property
> > that applications may need when they want to store the encoding.
> >
> > of course the application is free to choose what information to store
> > in this property. for example, an zipped xml-file could have:
> >  jcr:mimeType "text/xml"
> >  jcr:encoding "gzip"
> > although this might not make sense :-)
>
> No,
>
> that in fact does not make any sense, so don't do it.
>
> In case the binary content can be decoded into characters, the
> jcr:encoding property should hold the name of the character encoding
> (registry at <http://www.iana.org/assignments/character-sets>). In this
> case, it can be used to construct the encoding parameter for an MIME
> Content-Type header (for instance, when serving the content through HTTP).

well, it should have been named jcr:charset or jcr:charsetEncoding then :-)
but of course the spec is very clear of how to use this property as
paco quoted above:

"The jcr:encoding indicates the character set encoding used. If this
resource does not contains character data then this property will not
be present"

regards, toby
-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Mime
View raw message