Skip site navigation (1) Skip section navigation (2)

creating utf-8 random strings

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: creating utf-8 random strings
Date: 2011-12-25 15:16:18
Message-ID: 20111225161618.2efd00f9@anubis.defcon1 (view raw or flat)
Thread:
Lists: pgsql-novice
Hi list,

In order to make tests I must create strings [20-32] & [32-64]
characters long with accentuated characters.

I use a very old piece of code (not even accurated, but sufficient
until now), however it don't give me lower-case nor accentuated :
for b in range(random.randint(48, 64)):
    chiffre = random.randint(65, 88)
    myStr += unichr(chiffre)

Does somebody has such code?

JY
-- 

Responses

pgsql-novice by date

Next:From: ThangalinDate: 2011-12-27 08:11:00
Subject: Map table data to XPath expressions
Previous:From: Takahiro NodaDate: 2011-12-22 06:11:09
Subject: Re: The exact timing at which CHECK constraints are checked

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group