473,408 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Utf-8 order by problem

3
hello all,

I have a table that in ms access has a "first_name" and "last_name" fields
all the data is in utf-8 encoding
when i try to make a query like:

SELECT * FROM myTable order by last_name;

I get all the rows but they are not ordered alphabetically
they are ordered by the utf-8 order.

how can i get the rows orderd alphabetically?
Mar 26 '07 #1
7 2917
MMcCarthy
14,534 Expert Mod 8TB
hello all,

I have a table that in ms access has a "first_name" and "last_name" fields
all the data is in utf-8 encoding
when i try to make a query like:

SELECT * FROM myTable order by last_name;

I get all the rows but they are not ordered alphabetically
they are ordered by the utf-8 order.

how can i get the rows orderd alphabetically?
Try this...
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM myTable order by last_name ORDER BY last_name;
  2.  
Mary
Mar 26 '07 #2
dushy
3
do you mean that i need to put the order by 2 times???

i get error
Syntax error in ORDER BY clause

when i do
order by last_name ORDER BY last_name

what do you mean?
Mar 27 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Sorry I was half asleep last night doing this. Ignore my previous post. I'll have to do some research on this and get back to you. In the meantime someone else may have the answer.

Mary
Mar 27 '07 #4
NeoPa
32,556 Expert Mod 16PB
hello all,

I have a table that in ms access has a "first_name" and "last_name" fields
all the data is in utf-8 encoding
when i try to make a query like:

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM myTable order by last_name;
I get all the rows but they are not ordered alphabetically
they are ordered by the utf-8 order.

how can i get the rows orderd alphabetically?
I don't even get utf-8 encoding as an option :confused:
I would run an update query to change the stored data to the form you need.
Mar 28 '07 #5
Killer42
8,435 Expert 8TB
I don't even get utf-8 encoding as an option :confused:
I would run an update query to change the stored data to the form you need.
If the data is required in the current format, what about sorting on a calculated column which uses a user-defined function (or whatever) to convert to a more readily sorted format?

This is more of a last-resort workaround, and may only be an option if retrieving fairly small sets of data. But worth keeping in mind if all else fails.
Mar 28 '07 #6
Denburt
1,356 Expert 1GB
If you could provide me with more information about how this data was entered I might be able to help.

I found this and If I understand this correctly....
maybe it will help:

UTF-8

Right-to-left enabled Access supports several code pages used in importing, saving, and exporting HTML Web pages.

Code page conversion of tables or worksheets with right-to-left characteristics is provided for HTML files stored in logical (logical: Used to describe insertion point movement and text selection when working with bidirectional text. Movement progresses within bidirectional text according to the direction of the language encountered.) text layout and one of the following right-to-left code pages:
Language Code page
Arabic UTF-8 (default)
ISO 8859-6
DOS-720
ASMO-708
Hebrew UTF-8 (default)
ISO 8859-8
DOS-862

Note Access supports editing and saving of HTML files in logical text layout. HTML files stored in visual (visual: Used to describe insertion point movement and text selection when working with bidirectional text. Movement progresses within bidirectional text by moving to the next visually adjacent character.) text layout can be viewed but not edited or saved in logical text layout.

I suggest utilizing some HTML skills (determine the programming language used) and organize it in a manner more suited to your needs...

There are so many options.....
Mar 28 '07 #7
Killer42
8,435 Expert 8TB
I wonder also whether this may be relevant...
Specify the default language sort order (MDB)
Note The information in this topic applies only to a Microsoft Access database (.mdb).
  1. On the Tools menu, click Options.
  2. Click the General tab.
  3. To specify the default language sort order for a new database, click the language that you want to use in the New database sort order box.
Note To reset the sort order for an existing database to the language that you selected in the General tab, compact that database.
Mar 28 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: lawrence | last post by:
Someone on www.php.net suggested using a seems_utf8() method to test text for UTF-8 character encoding but didn't specify how to write such a method. Can anyone suggest a test that might work?...
38
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I...
32
by: Wolfgang Draxinger | last post by:
I understand that it is perfectly possible to store UTF-8 strings in a std::string, however doing so can cause some implicaions. E.g. you can't count the amount of characters by length() | size()....
6
by: archana | last post by:
Hi all, can someone tell me difference between unicode and utf 8 or utf 18 and which one is supporting more character set. whic i should use to support character ucs-2. I want to use ucs-2...
7
by: Jimmy Shaw | last post by:
Hi everybody, Is there any SIMPLE way to convert from UTF-16 to UTF-32? I may be mixed up, but is it possible that all UTF-16 "code points" that are 16 bits long appear just the same in UTF-32,...
1
by: sheldon.regular | last post by:
I am new to unicode so please bear with my stupidity. I am doing the following in a Python IDE called Wing with Python 23. äöü äöü '\xc3\xa4\xc3\xb6\xc3\xbc' u'\xe4\xf6\xfc'...
10
by: Jed | last post by:
I have a form that needs to handle international characters withing the UTF-8 character set. I have tried all the recommended strategies for getting utf-8 characters from form input to email...
23
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars...
35
by: Bjoern Hoehrmann | last post by:
Hi, For a free software project, I had to write a routine that, given a Unicode scalar value U+0000 - U+10FFFF, returns an integer that holds the UTF-8 encoded form of it, for example, U+00F6...
4
by: =?ISO-8859-2?Q?Boris_Du=B9ek?= | last post by:
Hi, I have an API that returns UTF-8 encoded strings. I have a utf8 codevt facet available to do the conversion from UTF-8 to wchar_t encoding defined by the platform. I have no trouble...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.