FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Random string from selected Unicode character set (test data)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Random string from selected Unicode character set (test data) [message #177361 is a reply to message #177359] Sun, 18 March 2012 00:30 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
Horst Lemminger wrote:
> I am implementing the script from generatedata.com
>
> But I would like for it to also display Unicode chars, so I can test
> other languages.
>
> I have looked everywhere, but can't seem to find a PHP function that
> lets me do something like
>
> $outstring .= $make_unicode_random('katakana');
>
> thereby selecting things from the code points U+30A0 .. U+30FF
>
> etc
>
I would simply make an indexed array of all the characters you want to
select from, and then randmonly index into that.

I've done similar in the past by writing a program to write the source
code of a large lookup table.

Sometimes the 'table' approach is just simpler (and much faster) than an
algorithmic approach unless you are REALLY strapped for code/static
memory..

Which is unlikely to be the case with a typical LAMP type installation.

> The strings could be defined more broadly like "japanese" etc for
> language separation. Not important.
>
use separate tables for each character set..

> Point is to get a string of 1..n chars of a certain language group, be
> it Greek, European accents, Japanese, Mandarin, Hangul etc
>
> I have found a project "babel" which is a .NET application. Not sure
> if it's open sourced.
>
> Anyone have some pointers to this project ?
>
Not me

--
To people who know nothing, anything is possible.
To people who know too much, it is a sad fact
that they know how little is really possible -
and how hard it is to achieve it.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Re: openssl_pkcs7_sign with key file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 20:48:01 GMT 2024

Total time taken to generate the page: 0.04152 seconds