Hi,

I have an issue related to this and the PostgresSQL ODBC driver.  When
I issue the following command in the console, it returns the correct
result:

select '£'

STRINGDECODE('\u00a3')
£

But, when I issue the same command via the ODBC driver, I get this:

stringdecode('\ufffd')
�

I'm not sure if the character is getting mangled on the way in or way
out.  Does anyone know if there's a setting to getting the correct
result?

Thanks,
Victor

On Jun 21, 2:32 am, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> Thanks! I tried to implement this in the Shell tool, but it's not
> enough to change the encoding of the input stream, you would also need
> to set the encoding of the output stream. That would require quite a
> big change. Also, I'm hesitant to hard-code the code pages.
>
> In the next release, the Shell tool will display the workaround:
>
> > java org.h2.tools.Shell -?
>
> Interactive command line tool to access a database using JDBC.
> Usage: java org.h2.tools.Shell <options>
> Options are case sensitive. Supported options are:
> [-help] or [-?]    Print the list of options
> [-url <url>]       The database URL (jdbc:h2:...)
> [-user <user>]     The user name
> [-password <pwd>]  The password
> [-driver <class>]  The JDBC driver class to use (not required in most cases)
> If special characters don't work as expected, you may need to use
>  -Dfile.encoding=UTF-8 (Mac OS X) or CP850 (Windows).
> See alsohttp://h2database.com/javadoc/org/h2/tools/Shell.html
>
> Regards,
> Thomas
>
>
>
> On Tue, Apr 28, 2009 at 12:50 AM, michaelm<[email protected]> wrote:
>
> > Hi Thomas,
>
> > If I set the encoding to cp850 (native encoding of dos console) in the
> > java command line, I get what you say :
>
> > sql> SELECT 'ä', STRINGDECODE('\u00e4');
> > STRINGDECODE('\u00e4')|STRINGDECODE('\u00e4')
> > ä                     |ä
> > (1 row, 16 ms)
> > sql>
>
> > Maybe it is possible to change the nativecodepageof the windows
> > console with chcp command.
> > I could get a correct result from jEdit setting jEdit shell option and
> > -Dfile.encoding to cp1252
>
> > but it did not work with utf-8 which displays :
> > sql> SELECT 'ä', STRINGDECODE('\u00e4');
> > STRINGDECODE('\ufffd')|STRINGDECODE('\u00e4')
> >                     |ä
> > (1 row, 46 ms)
>
> > Thanks for the help
>
> > Michaël Michaud
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to