This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can device name support multi-language

Hi,

We have a device needs to support user change the device name. We already finished this function. The changed device name can be store in internal flash, and broadcast from next advertising. My question is: whether the device name can support multi-language. The user scenario as below,

  1. User set their favorite name through Android or iOS App, the name may be in Chinese, Japanese, German,...or any other country language.
  2. nRF51822 store the new name in the internal flash.
  3. Next advertising, user can see their setting name on App correctly.

Please give me any your advice to achieve this function. Thanks for any coming information.

Parents
  • From the Bluetooth spec

    12.1 DEVICE NAME CHARACTERISTIC
    The Device Name characteristic shall contain the name of the device as an UTF-8 string ...
    

    Since UTF8 encodes every unicode codepoint then you can have any and every language you like.

Reply
  • From the Bluetooth spec

    12.1 DEVICE NAME CHARACTERISTIC
    The Device Name characteristic shall contain the name of the device as an UTF-8 string ...
    

    Since UTF8 encodes every unicode codepoint then you can have any and every language you like.

Children
  • Thanks for your prompt response. But sorry, I have no idea to realize it. How do I modify my FW to store UTF-8 string in nrf51822? And what should be dealt with on App?

    Please share more details. Thank you.

  • Well start by looking UTF8 up with google. Secondly you probably don't have to do anything, UTF8 is the most common encoding for strings - I see you've asked about iOS before, that's what iOS uses, that's what OSX uses, that's what Windows uses. So the string you get is most likely UTF8 anyway so you store it just like before and send it back just like before. There is nothing to do.

  • RK, thanks for your comment. Then can I directly use the "sd_ble_gap_device_name_set()" function to change the device name as that UTF8 string which was set from App? And next advertising, can I see the correct device name (Chinese or Japanese...) from the Bluetooth setting on Android device?

    I tried this , but not success. Should I need to modify somewhere to make it work?

  • yes if you're sending it a UTF8 string and then setting that string as the name it should just work. UTF8 is just a sequence of bytes. So either you're not sending UTF8 or the androd device displaying the name isn't displaying UTF8.

  • RK, sorry for late reply. You are right, we modified our App to encode and decode with UTF-8. We don't need to modify FW code too mch.

    Thank you. I close this issue.

Related