Hi David,
I am already using Lucida Console font. Without chcp 65001, sqlite3.exe
will display LATIN SMALL LETTER E WITH ACUTE (U+00E9) correctly. But I
can't figure out how to display EURO SIGN (U+20AC). Lucida Console
definitely has the glyph, otherwise my test "type utf8test.txt" would have
failed. Also REGISTERED SIGN (U+00AE) is displayed as "r" (i.e. not
enclosed in a circle). Simon Slavin pointed out that Windows Console
doesn’t support multibyte characters. Despite that, other console programs
I use are able to display these characters correctly with code page 65001
active - even a simple c program with printf("héllo wo®ld€"); works.
Does anyone know how to display characters like these in the sqlite3.exe
command line utility under Windows 10 (either cmd.exe or powershell.exe)?
On 5 June 2017 at 18:10, David Raymond <[email protected]> wrote:
> For the command prompt best I can suggest is changing the font to one of
> the TrueType fonts listed there like Lucida Console, then not touching the
> code page. Doing chcp 65001 <used> to help, but then in some release
> something got added to the CLI to try and help with that automatically.
> With the examples you gave I'm still not seeing the Euro sign, but at least
> I'm seeing the é.
>
> I haven't messed with it in a while, but also note that you can
> potentially get issues when using the alt+4numbers to enter something on
> the command line if you've messed with the code page. You can do alt+0233
> to get the é for example, and the glyph on the screen will show the accent,
> and if you do a select statement it will show the same glyph with the
> accent, but the data that actually got inserted was something different.
> The code page just interpreted the "incorrect" raw data to be what you were
> expecting to see. If there's ever a doubt you can use the unicode()
> function to get a code point value. If the console can't display the
> resulting 0-9 numerals ok, then there's a bigger problem to worry about.
>
>
> D:\>chcp
> Active code page: 437
>
> D:\>sqlite3
> SQLite version 3.19.2 2017-05-25 16:50:27
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
>
> sqlite> select char(233);
> char(233)
> é
>
> sqlite> select unicode(char(233));
> unicode(char(233))
> 233
>
> sqlite> select unicode('é');--input with alt+0233
> unicode('é')
> 233
>
> sqlite> .exit
>
> D:\>chcp 65001
> Active code page: 65001
>
> D:\>sqlite3
> SQLite version 3.19.2 2017-05-25 16:50:27
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
>
> sqlite> select char(233);
> char(233)
> �
>
> sqlite> select unicode(char(233));
> unicode(char(233))
> 233
>
> sqlite> select unicode('é');--input with alt+0233, crashes back to command
> prompt
>
>
> D:\>
>
>
> -----Original Message-----
> From: sqlite-users [mailto:[email protected]]
> On Behalf Of Shane Dev
> Sent: Sunday, June 04, 2017 4:06 PM
> To: [email protected]
> Subject: [SPAM] [sqlite] Fwd: How to correctly display unicode characters
> in Windows 10 / cmd.exe / sqlite3.exe?
> Importance: Low
>
> Hello,
>
> After logging in to Windows 10, I open a command prompt (cmd.exe) and
> change the code page to Unicode (UTF-8)
>
> >chcp 65001
> Active code page: 65001
>
> then I test this with a UTF-8 file -
>
> >type utf8test.txt
> néo66€
>
> next I execute sqlite-tools-win32-x86-3190200\sqlite3.exe and check the
> encoding
>
> sqlite> pragma encoding;
> UTF-8
>
> then I try to print some characters to screen -
>
> sqlite> select char(0x006e); --Unicode LATIN SMALL LETTER N
> n
> sqlite> select char(0x00e9); --Unicode LATIN SMALL LETTER E WITH ACUTE
>
> sqlite> select char(0x006f); --Unicode LATIN SMALL LETTER O
> o
> sqlite> select char(0x20ac); --Unicode EURO SIGN
> ?
>
> only the ascii characters are displayed correctly. Next I test outputting
> the euro sign to a file -
>
> sqlite> .once eurotest.txt
> sqlite> select char(0x20ac); --unicode EURO SIGN
> sqlite> .quit
>
> .. and from the command prompt -
>
> >type eurotest.txt
> €
>
> Why can't I display these Unicode characters from sqlite3 command line
> utility?
>
> P.S I have a similar in powershell but not in Ubuntu.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users