View Single Post
Posts: 10 | Thanked: 0 times | Joined on Feb 2010
#249
Originally Posted by dwould View Post
weird, witter just asks for the length of the string in the entry box. presumably gtk thinks it*'s three characters.
i was considering switching from a hard limit to a warned limit which would let you send and just get truncated if twitter doesn't like it.

do you have any experience coding for chinese characters? any special calculation to get the o****ing 'right'?
sorry i'm not understand the code of n900.
chinese characters in linux we always use utf8,
In website we use utf8 unicode and other china criterion.
i just know php, i can give you some code of php

$str = "我sadasdas" // this must use utf8 code .
for ($i=0 ; $i<strlen($str);$i++)
{
if(ord( $str{$i} )> 127)
{
$length++;
i++;
}else{
$length++;
}

}
echo $str." length is ".$length; //我sadasdas length is 9