how to get BaseXClient console speak unicode under Windows ?
Thursday, 27 January 2011 · 8 messages
FE
Fabrice Etanchaud27 Jan 2011 11:49 #
Dear all,
under Windows,
I would like to see correct unicode results when running Xqueries under BaseXClient application (xml content is in russian).
Could you please help me ?
best regards,
Fabrice Etanchaud
CG
Christian Grün27 Jan 2011 14:43 #
Hi Fabrice,
BaseX itself always returns UTF8. Which clients/APIs are you currently using?
C.
Quoted text · Fabrice Etanchaud · 16 lines
On Thu, Jan 27, 2011 at 11:49 AM, Fabrice Etanchaud <fetanchaud at edital.com> wrote: > Dear all, > under Windows, > I would like to see correct unicode results when running Xqueries under > BaseXClient application (xml content is in russian). > Could you please help me ? > > best regards, > Fabrice Etanchaud > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
FE
Fabrice Etanchaud27 Jan 2011 14:47 #
I beg your pardon, my email was not clear.
I am using the org.basex.BaseXClient console (basexclient.bat)
Thanks,
Fabrice.
Quoted text · Christian Grün · 24 lines
-----Original Message----- From: Christian Grün [mailto:christian.gruen at gmail.com] Sent: jeudi 27 janvier 2011 14:43 To: Fabrice Etanchaud Cc: basex-talk at mailman.uni-konstanz.de Subject: Re: [basex-talk] how to get BaseXClient console speak unicode under Windows ? Hi Fabrice, BaseX itself always returns UTF8. Which clients/APIs are you currently using? C. On Thu, Jan 27, 2011 at 11:49 AM, Fabrice Etanchaud <fetanchaud at edital.com> wrote: > Dear all, > under Windows, > I would like to see correct unicode results when running Xqueries > under BaseXClient application (xml content is in russian). > Could you please help me ? > > best regards, > Fabrice Etanchaud > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
CG
Christian Grün27 Jan 2011 15:01 #
Quoted text · Fabrice Etanchaud · 2 lines
> I beg your pardon, my email was not clear. > I am using the org.basex.BaseXClient console (basexclient.bat)
No problem. – It might be that your console doesn't correctly display the UTF8 results. Which OS/bash are you using, and what's default encoding of your OS?
Christian
FE
Fabrice Etanchaud27 Jan 2011 15:21 #
I'm on windows 7...
I tried cmd /U with java -Dfile.encoding=UTF8, but this does not work...
Regards,
Fabrice
Quoted text · Christian Grün · 10 lines
-----Original Message----- From: Christian Grün [mailto:christian.gruen at gmail.com] Sent: jeudi 27 janvier 2011 15:02 To: Fabrice Etanchaud Cc: basex-talk at mailman.uni-konstanz.de Subject: Re: [basex-talk] how to get BaseXClient console speak unicode under Windows ? > I beg your pardon, my email was not clear. > I am using the org.basex.BaseXClient console (basexclient.bat) No problem. - It might be that your console doesn't correctly display the UTF8 results. Which OS/bash are you using, and what's default encoding of your OS? Christian
CG
Christian Grün27 Jan 2011 18:23 #
Quoted text · Fabrice Etanchaud · 2 lines
> I'm on windows 7... > I tried cmd /U with java -Dfile.encoding=UTF8, but this does not work...
Hm, this is indeed a general terminal issue, which can't be solved from within BaseX. Instead, you could change the output encoding for XQuery results to match the console encoding. An example:
Quoted text · Fabrice Etanchaud · 1 line
> basex -sencoding=850 YourQuery.xq
…or (using the console mode)…
BaseX 6.5.1 [Standalone]
Try "help" to get more information.
Quoted text · Fabrice Etanchaud · 3 lines
> set serializer encoding=850 SERIALIZER: encoding=850 > run YourQuery.xq
....
Hope this helps,
Christian
JE
Jens Erat27 Jan 2011 19:08 #
You can easily switch command line's encoding to utf8 using
chcp 65001
I just checked and at least German umlauts were displayed correctly, using default codepage 850 they did show up as mojibake.
@Christian: BaseX client crashes in svn head when querying
XQUERY 'ä' using utf8, not in 65001 - as querying a database containing umlauts didn't crash the client, it seems to be an error in proceeding the input? Jens Erat
» web: www.jenserat.de » email: jens.erat at uni-konstanz.de » phone: 0151 56961126 » weitere und aktuelle Kontaktmöglichkeiten: www.jenserat.de/kontakt
Quoted text · Christian Grün · 26 lines
Am 27.01.2011 um 18:23 schrieb Christian Grün: >> I'm on windows 7... >> I tried cmd /U with java -Dfile.encoding=UTF8, but this does not work... > > Hm, this is indeed a general terminal issue, which can't be solved > from within BaseX. Instead, you could change the output encoding for > XQuery results to match the console encoding. An example: > >> basex -sencoding=850 YourQuery.xq > > …or (using the console mode)… > > BaseX 6.5.1 [Standalone] > Try "help" to get more information. > >> set serializer encoding=850 > SERIALIZER: encoding=850 >> run YourQuery.xq > .... > > Hope this helps, > Christian > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
JE
Jens Erat27 Jan 2011 19:56 #
Leo and me just did some more research on the problem... BaseX seems to be fine, Windows command line (and also PowerShell) seem to have some serious problems with umlauts in UTF-8. Just switch to UTF-8 in powershell and enter one umlaut and send the input and it will crash...
umlauts aren't even passed to java,
Quoted text · Jens Erat · 1 line
> System.console().readLine()
returns null - umlauts seem to trigger end of input.
So you will be able to print utf-8 characters, but not input them in queries. Maybe use putty and a local telnet server could help as it seems to be a command line problem... Jens Erat
» web: www.jenserat.de » email: jens.erat at uni-konstanz.de » phone: 0151 56961126 » weitere und aktuelle Kontaktmöglichkeiten: www.jenserat.de/kontakt
Quoted text · Jens Erat · 40 lines
Am 27.01.2011 um 19:08 schrieb Jens Erat: > You can easily switch command line's encoding to utf8 using > chcp 65001 > > I just checked and at least German umlauts were displayed correctly, using default codepage 850 they did show up as mojibake. > > @Christian: BaseX client crashes in svn head when querying > XQUERY 'ä' using utf8, not in 65001 - as querying a database containing umlauts didn't crash the client, it seems to be an error in proceeding the input? > Jens Erat > » web: www.jenserat.de » email: jens.erat at uni-konstanz.de » phone: 0151 56961126 > » weitere und aktuelle Kontaktmöglichkeiten: www.jenserat.de/kontakt > > Am 27.01.2011 um 18:23 schrieb Christian Grün: > >>> I'm on windows 7... >>> I tried cmd /U with java -Dfile.encoding=UTF8, but this does not work... >> >> Hm, this is indeed a general terminal issue, which can't be solved >> from within BaseX. Instead, you could change the output encoding for >> XQuery results to match the console encoding. An example: >> >>> basex -sencoding=850 YourQuery.xq >> >> …or (using the console mode)… >> >> BaseX 6.5.1 [Standalone] >> Try "help" to get more information. >> >>> set serializer encoding=850 >> SERIALIZER: encoding=850 >>> run YourQuery.xq >> .... >> >> Hope this helps, >> Christian >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery