• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

make the length of Japanese character is twice as English character exactly?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have encounter a problem about the Japanese language ,

According to the customer's requirement, I have to make a good order for the character that they input, there will be the mixed English and Japanese characters in one line, so I should make them in a good order per their requirement, But in the browser, the length of 1 double byte character can't match 2 single byte character exactly, who can tell me which font-family can I use to achieve this purpose?
for example:

デ始
1234

there are 2 Japanese character, I want to the length is the same as the following "1234", each double byte character match 2 single character in browser.
So How can I do that? who can give me some suggestion on this? Thanks in advance!

 
Ranch Foreman
Posts: 275
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On sorting to sort words or characters, I have experienced non English characters always precede the English ones and numbers.
Probably because of their value in the UTF charset.
Ordering is same as sorting and should be following the UTF-8 value sof those.
Also, it follows the dictiionary algorithm. if the first character is japanese, it will appear before numbers and English characters.

One thing I don't understand here is, why are you trying to order Strings by their size?
 
Vincent Hou
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aniruddh Joshi wrote:On sorting to sort words or characters, I have experienced non English characters always precede the English ones and numbers.
Probably because of their value in the UTF charset.
Ordering is same as sorting and should be following the UTF-8 value sof those.
Also, it follows the dictiionary algorithm. if the first character is japanese, it will appear before numbers and English characters.

One thing I don't understand here is, why are you trying to order Strings by their size?



Thanks for your suggestion, the function I want to implement here is like a notepad , the users can input characters row by row what they want to , it can be mixed with English and Japanese , and for each row , it have a limitation,
for the layout problem , I have to make them in a good order ,the size of each Japanese character must twice as 1 English character, so that my content can be a good order. so is any other directions to me ? thanks!
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic