Re: [sqlite] hex and char functions

2017-08-07 Thread Darko Volaric
Actually a maximum of 4 bytes are required to encode a single valid code-point in UTF-8. > On Aug 8, 2017, at 2:44 AM, Jens Alfke wrote: > > >> On Aug 7, 2017, at 8:29 AM, x wrote: >> >> I thought I had learned enough about this string lunacy to

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-07 Thread Jens Alfke
> On Aug 7, 2017, at 2:02 AM, Brian Clifford > wrote: > > I have looked into using a user defined function however it was very slow. It’s quite expensive to call from unmanaged (native) code into managed (C#/Java) code. If possible, write the user defined

Re: [sqlite] hex and char functions

2017-08-07 Thread Jens Alfke
> On Aug 7, 2017, at 8:29 AM, x wrote: > > I thought I had learned enough about this string lunacy to get by but finding > out that the UTF8 code for the UTF16 code \u0085 is in fact \uc285 has tipped > me over the edge. I assumed they both used the same codes but UTF16

Re: [sqlite] hex and char functions

2017-08-07 Thread x
Thanks Ryan for going to the trouble of typing that out. Hope you’re not a one fingered typewriter like myself. The borland related stuff is welcome but I still can’t say I’m any less confused by it all. I’m having a bad day today. I’ve spent most of it trying to fathom this stuff out. Igor &

Re: [sqlite] hex and char functions

2017-08-07 Thread R Smith
On 2017/08/07 5:29 PM, x wrote: Apologies, I should have said I was using c++ builder Berlin on windows 10 and that UnicodeString was UTF16. I thought I had learned enough about this string lunacy to get by but finding out that the UTF8 code for the UTF16 code \u0085 is in fact \uc285 has

Re: [sqlite] hex and char functions

2017-08-07 Thread R Smith
On 2017/08/07 9:01 PM, x wrote: Thanks Ryan for going to the trouble of typing that out. Hope you’re not a one fingered typewriter like myself. The borland related stuff is welcome but I still can’t say I’m any less confused by it all. I’m having a bad day today. I’ve spent most of it trying

Re: [sqlite] hex and char functions

2017-08-07 Thread Simon Slavin
On 7 Aug 2017, at 8:45pm, R Smith wrote: > If it ends up as something else in that database, follow the call stack > chain, see how those look in the debugger initially (which may be different > to what you expect, depending on the debugger display encoding) Note this

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-07 Thread Brian Clifford
Thank Simon, I have looked into using a user defined function however it was very slow. I tried to create an expression index unfortunately I was not able as the function was seen as non deterministic. (I am using the C# interface and its not possible to define a user defined function as

Re: [sqlite] Selecting NEXT / PREVIOUS recurring item in a column

2017-08-07 Thread Simon Slavin
On 7 Aug 2017, at 6:38am, Edmondo Borasio wrote: > I am unable to test it.. Completely out of the blue yesterday > I got this error message and OpenSuse is no longer starting on VirtualBox > (Mac). Can’t fix your problem but Macs come with the SQLite command line

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Lars Frederiksen
Hi Gunter and Clemens! Thank you for your help. I appears that the Connection Editor in FDConnection has a StringFormat property and after setting this to Unicode the problem was solved. Regards Lars -Oprindelig meddelelse- Fra: sqlite-users

Re: [sqlite] hex and char functions

2017-08-07 Thread Hick Gunter
The sqlite char() function returns unicode. Apparently, the encoding for code point 133 is two characters, namely c2 85. You seem to be expecting char() to return ISO characters, which it does not do. Calling sqlite3_value_text16 instructs SQLite to convert the contents of the field into utf16

Re: [sqlite] hex and char functions

2017-08-07 Thread Igor Tandetnik
On 8/7/2017 9:38 AM, x wrote: In c++ I tried to call a sqlite udf using the following sql UnicodeString SQL=“select udf(‘5\u00856’);” You are using a narrow string literal to try and hold a Unicode character. You are at the whim of your compiler as to how it represents the latter in the

[sqlite] hex and char functions

2017-08-07 Thread x
In c++ I tried to call a sqlite udf using the following sql UnicodeString SQL=“select udf(‘5\u00856’);” Which was prepared using sqlite3_prepare16_v2. (I was experimenting with sending a udf a group of numbers without getting involved with blobs). Debugging the udf I recovered the string

Re: [sqlite] hex and char functions

2017-08-07 Thread Igor Tandetnik
On 8/7/2017 9:38 AM, x wrote: Related Select hex(char(65,133,66)); returns ‘41C28542’ whereas I expected ‘418542’. What is the ‘C2’ about? Two-byte sequence C2 85 is the UTF-8 encoding of the Unicode codepoint U+0085. -- Igor Tandetnik ___

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Lars Frederiksen
Thank you Clemens! I am trying to learn FireDAC and SQLite, indeed a steep learning curve! I just realized that it is possible to replace TEXT with VARCHAR(). I have followed 2 tutorials about SQLite, and none of these mentioned the VARCHAR() possibility But I also realized that it is not

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Clemens Ladisch
Lars Frederiksen wrote: > I have followed 2 tutorials about SQLite, and none of these mentioned the > VARCHAR() possibility Because SQLite pretty much ignores column types. Interpreting "VARCHAR" this way is how FireDAC does things; you have to look into the FireDAC documentation. > But I

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Hick Gunter
It would be so much easier if you could provide hex dumps of the strings involved. Maybe just a few characters and a verbal description of what you think you are storing (greek lowercase alpha, ...). From appearances it seems that your text objects are locale aware, which would suggest a

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Clemens Ladisch
Lars Frederiksen wrote: > CREATE TABLE gms( > gms_id INTEGER PRIMARY KEY, > gms_verb TEXT NOT NULL > ); > > FDTable1.Append; > FDTable1.FieldByName('gms_verb').AsString:= Edit1.Text; > FDTable1.Post; > > But when I put a string in the table 'gms_verb' I only get the primary key > number - the

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Hick Gunter
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Lars Frederiksen Gesendet: Montag, 07. August 2017 09:00 An: 'SQLite mailing list' Betreff: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid ... But I also realized that

Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Lars Frederiksen
Hi, My code is simple. FDConnection, FDQuery, DataSource + DBGrid, 3 Edits and a button. Then this OnClick event: Procedure TForm1.Button1Click(Sender: TObject); begin FDTable1.Open; FDTable1.Append; FDTable1.FieldByName('gms_id').AsInteger:= StrToInt(edNummer.Text);

Re: [sqlite] Can I used BLOB to see a string in Hex ?

2017-08-07 Thread Simon Slavin
On 7 Aug 2017, at 4:31pm, Richard Hipp wrote: > Use the hex() SQL function. D’oh. Completely forgot that. Thanks. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] hex and char functions

2017-08-07 Thread Richard Hipp
On 8/7/17, Nico Williams wrote: > > Internally SQLite3 uses UTF-8. The SQLite3 API lets you deal with > UTF-16, but this just transcodes to/from UTF-8 internally. > That is not quite correct. SQL statements are always converted into UTF8 for parsing and code generation.

Re: [sqlite] hex and char functions

2017-08-07 Thread Nico Williams
On Mon, Aug 07, 2017 at 11:45:50AM -0400, Richard Hipp wrote: > On 8/7/17, Nico Williams wrote: > > Internally SQLite3 uses UTF-8. The SQLite3 API lets you deal with > > UTF-16, but this just transcodes to/from UTF-8 internally. > > That is not quite correct. > > SQL

Re: [sqlite] Can I used BLOB to see a string in Hex ?

2017-08-07 Thread Richard Hipp
On 8/7/17, Simon Slavin wrote: > Suppose I have a Unicode string stored in a TEXT field in a database. The > string might contain complicated Unicode compound characters, but it was > properly composed. By this I mean that the string is correctly > Unicode-encoded by

[sqlite] Can I used BLOB to see a string in Hex ?

2017-08-07 Thread Simon Slavin
Suppose I have a Unicode string stored in a TEXT field in a database. The string might contain complicated Unicode compound characters, but it was properly composed. By this I mean that the string is correctly Unicode-encoded by Unicode-aware software and OS, with no mistakes about how

Re: [sqlite] hex and char functions

2017-08-07 Thread x
Apologies, I should have said I was using c++ builder Berlin on windows 10 and that UnicodeString was UTF16. I thought I had learned enough about this string lunacy to get by but finding out that the UTF8 code for the UTF16 code \u0085 is in fact \uc285 has tipped me over the edge. I assumed

Re: [sqlite] hex and char functions

2017-08-07 Thread Nico Williams
On Mon, Aug 07, 2017 at 03:29:41PM +, x wrote: > Apologies, I should have said I was using c++ builder Berlin on > windows 10 and that UnicodeString was UTF16. > > I thought I had learned enough about this string lunacy to get by but > finding out that the UTF8 code for the UTF16 code \u0085

[sqlite] 3rd Call For Papers - 24th Annual Tcl/Tk Conference (Tcl'2017)

2017-08-07 Thread akupries
Hello SQLite Users, fyi ... 24th Annual Tcl/Tk Conference (Tcl'2017) http://www.tcl.tk/community/tcl2017/ October 16 - 20, 2017 Crowne Plaza Houston River Oaks 2712 Southwest Freeway, 77098 Houston, Texas, USA Important Dates: [[ Attention! Counting down 2 weeks to the submission deadline.