Search Postgresql Archives

Re: psql weird behaviour with charset encodings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hernan gonzalez <hgonzalez@xxxxxxxxx> writes:
> Sorry about a error in my previous example (mixed width and precision).
> But the conclusion is the same - it works on bytes:

This example works like that because it's running in C locale always.
Try something like this:

#include<stdio.h>
#include<locale.h>

int main () {
        char s[] = "ni\xc3qo"; /* 5 bytes , not valid utf8 */

        setlocale(LC_ALL, "");
        printf("|%.*s|\n",3,s);
        return 0;
}


I get different (and undesirable) effects depending on LANG.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux