Hi,

I'm sorry, I'm afraid I'm not able to solve this problem. I tested

java -Dfile.encoding=UTF-8 org.h2.tools.Shell

on Mac OS X and it works, however on Windows XP it doesn't. On
Windows, I didn't find a way. My test case is:

java -Dfile.encoding=UTF-8 org.h2.tools.Shell
or
java org.h2.tools.Shell

Then connect to the database and execute:
SELECT 'ä', STRINGDECODE('\u00e4');
The expected result is:
STRINGDECODE('\u00e4')|STRINGDECODE('\u00e4')
ä                     |ä

Does somebody know how to solve this problem?

Regards,
Thomas





On Thu, Apr 23, 2009 at 8:48 PM, Thomas Mueller
<[email protected]> wrote:
> Hi,
>
> Currently the Shell tool uses the following code to read from system in:
>
> reader = new BufferedReader(new InputStreamReader(in));
>
> I was expecting this should work, but it looks like it doesn't. The
> Javadoc of System.in doesn't talk about the character set. Could you
> try the following please?
>
> java -Dfile.encoding=UTF-8 ...
>
> This works for me. If this is is the solution, then I will change the
> Shell tool as follows:
>
> reader = new BufferedReader(new InputStreamReader(System.in, "UTF-8"));
>
> Regards,
> Thomas
>
>
> On Wed, Apr 22, 2009 at 3:01 PM, michaelm <[email protected]> wrote:
>>
>> Hi,
>>
>> I tried to use the H2 Shell to execute CSVRead statements but
>> encountered problems to access a file with accented characters in its
>> path.
>> I use windows vista. I think the problem comes from the difference
>> between the default windows charset used to parse the sql script
>> (windows-1252 ?) and the default charset used by the console (cp
>> 850 ?).
>> I could execute the script by entering the windows-1252 byte-code of
>> the accented character in the console (which is not displayed
>> correctly), but this is not a solution.
>>
>> Finally, I used RunScript Tool which allows to use a charset option.
>>
>> Any idea how to solve charset problems with the Shell Tool ?
>>
>> Michaël
>>
>>
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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