Search code examples
web-servicestwittershare

Arabic With Twitter Tweet Service


I'm using the twitter tweet intent service and have run into a couple of issues in Arabic.

This is the call I am making: https://twitter.com/intent/tweet?lang=ar&text=%D8%A3%D8%AF%D8%B9%D9%85%20%D9%82%D8%A8%D9%88%D9%84%20%D8%A7%D9%84%D8%AC%D9%85%D9%8A%D8%B9%D8%8C%20%D9%81%D9%8A%20%D9%83%D9%84%20%D8%A7%D9%84%D8%A3%D9%85%D8%A7%D9%83%D9%86.%20%23Rio2016%20%23VisaAcceptance&url=http%3A%2F%2Flocalhost%3A3000%2Fmena-ar%2F

The decoded parameters which are being pass are: //text=أدعم قبول الجميع، في كل الأماكن. #Rio2016 #VisaAcceptance //lang=ar //url=http://localhost:3000/mena-ar/

It looks bad both when you are posting, the arrangement of the hashtag and URL are not working. And also when you view the post on twitter: https://twitter.com/maxquesar/status/756573965498195968

Is this a twitter bug, or does anybody have experience fixing this type of issue?


Solution

  • To support Arabic with hashtags with the twitter intent service. You must pass the hashtags parameter.

    This works correctly:

    https://twitter.com/intent/tweet?hashtags=Rio2016%2CVisaAcceptance&lang=ar&text=.%D8%A3%D8%AF%D8%B9%D9%85%20%D9%82%D8%A8%D9%88%D9%84%20%D8%A7%D9%84%D8%AC%D9%85%D9%8A%D8%B9%20%D9%81%D9%8A%20%D9%83%D9%84%20%D8%A7%D9%84%D8%A3%D9%85%D8%A7%D9%83%D9%86&url=http%3A%2F%2Flocalhost%3A3000%2Fmena-ar%2F

    The decoded params are:

    //text=أدعم قبول الجميع، في كل الأماكن.
    //lang=ar
    //url=http://localhost:3000/mena-ar/
    //hashtags=Rio2016,VisaAcceptance