Results 1 to 8 of 8

Thread: collate sequence

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    239

    Question collate sequence

    How could I generate an index for Lianja data table that also handles Hungarian accented characters?
    In VFP exists the INDEX ON ... COLLATE HUNGARIAN option, and the sys (15, ...) function. Is there a similar possibility in Lianja?
    Last edited by strato; 2021-08-29 at 03:00.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Lianja handles Utf-8 encoded data automatically. You just create an index on a column and it will be stored as utf-8 in the indexes. You don’t need to use national character sets.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Oct 2012
    Posts
    239
    unfortunately, utf-8 encoding does not solve this problem. The Hungarian accented letters in utf-8 code have 2 bytes, the first byte has an ascii code of 195, so these letters are all at the end of the ABC

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Sorry I do not understand what you mean.

    As I’ve already explained and you already should know Lianja uses Utf-8 to represent all Unicode characters. By using Utf-8 all characters for all languages even mixed languages can be used without having to decipher code pages.

    So no you cannot create indexes using language specific code pages.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Oct 2012
    Posts
    239
    probably it's my fault if I'm not well understood.
    Here's an example that might help you understand my problem:
    Code:
    open database southwind
    insert into employees (firstname, lastname) values ("Áron", "Örkény")
    use employees
    index on firstname tag firstname
    list firstname
    The result:
    Code:
      Record # firstname
             5 Andrew
             4 Anne
             7 Janet
             2 Laura
             8 Margaret
             9 Michael
             3 Nancy
             6 Robert
             1 Steven
            18 Áron
    (Expected order: Andrew, Anne, Áron, Janet .... etc)

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Yes the collating/sort order in Lianja is Utf-8 encoding order. It does not affect index searches.

    if that’s not what you need then the only solution would be to add a collate() function that would add strings into the index in the desired order.

    That would need an ER to be submitted and it would be considered for implementation in a future release.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    This has been implemented in Lianja 6.3

    1. Added new command SET COLLATE TO "language"
    2. Added new function COLLATE( cExp ) // use this in your indexes
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #8
    Senior Member
    Join Date
    Oct 2012
    Posts
    239

    thanks Barry!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us