Java Question Unicode characters b4a->java-library

Discussion in 'Libraries developers questions' started by DonManfred, Mar 1, 2015.

  1. DonManfred

    DonManfred Expert Licensed User


    in one of my library i need to set a unicode character (it is a icon from a iconfont)
    for ex
    In this case it works. But the string is hardcoded into the library.
    If i want to give this "string" from b4a to the java-lib
    then it is a normal string with the content \uf17b
    and the icon is not set correctly.

    What do i need to change to get this in java to work? Or i mean; what do i need to give as the value?


    I´ve tried to create a map with all Icons from the ttf font

    iconmap = new HashMap();
    "fa-android",  "\uf17b");
    if (iconmap.containsKey(iconres)==true){
    "Iconres found in map => "+iconmap.get(iconres));
    String s = (String)iconmap.get(iconres);
           btn.setIconResource(s); // 
           BA.Log("Iconres '"+iconres+"' NOT found in map");
    but this does not work either. What i am doing wrong?
    Last edited: Mar 1, 2015
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    What is the signature for setIconResource?
  3. Erel

    Erel Administrator Staff Member Licensed User

    You can use Chr(0xf17b).
    It is equivalent to "\uf17b"
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice