[ 
https://issues.apache.org/jira/browse/VELOCITY-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614485#action_12614485
 ] 

Christopher Schultz commented on VELOCITY-599:
----------------------------------------------

Why aren't we considering the use of ResultSet.getReader? Is it because the 
surrounding code expects an input stream? It seems to me that since Velocity is 
usually dealing with character data, Readers should be used, anyway.

Another option would be to allow the user to set the encoding, and then use 
code like this:

BufferedReader in = new BufferedReader(rs.getReader());
StringWriter buffer = new StringWriter();
// copy 'in' to 'buffer'
InputStream ascStream = new 
java.io.ByteArrayInputStream(in.getString().getBytes(encoding));

Unfortunately, this requires a bunch of memory to accomplish. :(


> DataSourceResourceLoader doesn't support UTF8
> ---------------------------------------------
>
>                 Key: VELOCITY-599
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-599
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>         Environment: WindowsServer2003 R2, 
> Oracle10g(10.2.0,UTF8characterSet),  jdk1.5.0_12
>            Reporter: markchen
>
> If templates are stored in the database instead of files,the characters 
> retrived becomes garbled.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to