Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Convert ç®?ä½?ä¸æ?? in Chinese to 简体中文&
Stedwick
12/11/2007 5:39:00 PM
ç®?ä½?ä¸æ??
converts to
简体中文
using this utility:
http://people.w3.org/rishida/scripts/uniview/conv...
Is there a way that I can get Ruby to do this for me?
Thanks!
Philip
--
Posted via
http://www.ruby-...
.
3 Answers
Daniel Berger
12/11/2007 7:30:00 PM
0
On Dec 11, 10:39 am, Philip Brocoum <philip.broc...@gmail.com> wrote:
> =BC=F2=CC=E5=D6=D0=CE=C4
>
> converts to
>
> 简体中文
>
> using this utility:
http://people.w3.org/rishida/scripts/uniview/c...
php
>
> Is there a way that I can get Ruby to do this for me?
string =3D "=BC=F2=CC=E5=D6=D0=CE=C4"
p string.unpack("U*").map{ |c| c =3D "&##{c};"}.join =3D>
"简体中文"
I'm not sure what the " " is. Whitespace? Should be " " then.
Regards,
Dan
Suraj Kurapati
12/11/2007 9:40:00 PM
0
Philip Brocoum wrote:
> ç®?ä½?ä¸æ??
>
> converts to
>
> 简体中文
>
> Is there a way that I can get Ruby to do this for me?
>> "ç®?ä½?ä¸æ??"
=> "\347\256\200\344\275\223\344\270\255\346\226\207"
>> "ç®?ä½?ä¸æ??".unpack('U*')
=> [31616, 20307, 20013, 25991]
>> "ç®?ä½?ä¸æ??".unpack('U*').map {|c| "&#{c};"}
=> ["&31616;", "&20307;", "&20013;", "&25991;"]
>> "ç®?ä½?ä¸æ??".unpack('U*').map {|c| "&#{c};"}.join
=> "&31616;&20307;&20013;&25991;"
--
Posted via
http://www.ruby-...
.
Stedwick
12/11/2007 9:59:00 PM
0
wow, thanks!
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Convert ç®?ä½?ä¸æ?? in Chinese to 简体中文&
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password