Bitcoin Forum
May 10, 2024, 09:15:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Account names encoding  (Read 1345 times)
tcatm (OP)
Sr. Member
****
qt
Offline Offline

Activity: 337
Merit: 265


View Profile
January 11, 2011, 04:05:05 AM
 #1

It seems like the RPC interface can't handle account names with non-ASCII characters properly. Copy&paste form listaccount to getaccountaddress will create a new account with yet another name.

Can we restrict accountnames to a limited charset (like [a-zA-Z0-9\-_]) or add UTF-8 support?
Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
grondilu
Legendary
*
Offline Offline

Activity: 1288
Merit: 1076


View Profile
January 11, 2011, 04:22:06 AM
 #2

I don't use accounts much, but UTF-8 would be cool indeed.   (utf-8 is actually always cool)

davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
January 11, 2011, 08:17:33 AM
 #3

I don't use accounts much, but UTF-8 would be cool indeed.   (utf-8 is actually always cool)
It also needs more cowbell

Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
January 11, 2011, 03:22:43 PM
Last edit: January 11, 2011, 03:33:42 PM by gavinandresen
 #4

Character set issues give me headaches.

So I just ran a test at the command-line, moving 500 testnet bitcoins to an account named "฿"

The account created is named "\u00E0\u00B8\u00BF", which is not what I intended.  E0 B8 BF is the utf-8 representation of the unicode Thai Baht character.

Thinking this through, trying hard not to get a headache...

My terminal window has:  LC_CTYPE=en_US.UTF-8
So when I copy&paste the Thai baht symbol, it is being encoded as UTF-8.

I pass a UTF-8 string to bitcoind, and it uses the JSON-Spirit library to convert it into a JSON string (which is defined to be Unicode... encoded using backslashes, I think: see http://www.ietf.org/rfc/rfc4627.txt ).  And there's the bug.  Maybe.  I think?

Command-line bitcoind should be looking at the locale and converting JSON strings to/from that locale.  Anybody motivated enough about internationalized account names (and send comments) to teach it to do that?

How often do you get the chance to work on a potentially world-changing project?
marcusaurelius
Newbie
*
Offline Offline

Activity: 37
Merit: 0



View Profile
January 11, 2011, 08:42:01 PM
 #5

that is something opaque to john user with the mainline client, right? if not, please point me in the right direction.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
January 11, 2011, 09:25:56 PM
 #6

RE: point you in the right direction:

File rpc.cpp, the CommandLineRPC method:

I suspect what needs to be done is to properly JSON encode any strings passed via the command line.

And then properly decode/recode any strings returned from the JSON RCP call before printing out the result.

How often do you get the chance to work on a potentially world-changing project?
tcatm (OP)
Sr. Member
****
qt
Offline Offline

Activity: 337
Merit: 265


View Profile
January 11, 2011, 09:35:13 PM
 #7

It's probably not only the CommandLineRPC method that causes problems. UTF-8 account names created from js-remote are wrong, too.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!