Question marks instead of Cyrillic?


I’m created a company using API, but when I send Cyrillic symbols in company name or description, it’s replace on question marks.

    HubSpotCompanyDto companyName = new HubSpotCompanyDto();
    companyName.setValue("Имя ком");
    HubSpotCompanyDto companyDescription = new HubSpotCompanyDto();
    String postUrl = "" + API_KEY;
    Gson gson = new Gson();
    HttpClient httpClient = HttpClientBuilder.create().build();
    HttpPost post = new HttpPost(postUrl);
    HubSpotCompanyPropertiesDto properties = new HubSpotCompanyPropertiesDto();
    properties.setProperties(Arrays.asList(companyName, companyDescription));
    StringEntity postingString = new StringEntity(gson.toJson(properties));
    post.setHeader("Content-type", "application/json");
    HttpResponse response = httpClient.execute(post);

company name in hubspot interface is ??? ???


Hi @Vlad,

Is the encoding set to UTF-8? I tested this request out and was able to successfully create a company with the name ‘Имя ком’


Yes, in my project encoding set to UTF-8, and I try
post.setHeader(“Content-type”, “application/json; charset=UTF-8”);
Does not help, still question marks.


Hi @Vlad,

While I’m not entirely familiar with your code (looks to be Java?) it looks like you might have to include the encoding in the parameters of your new StringEntity, like this:

StringEntity example = new StringEntity(data,"UTF-8"); 

You can see this format being used in the following examples. Can you try adding the encoding as a StringEntity parameter to see if that works?


Hi @Derek_Gervais,

Yes, Java. Thank you, it works )