0

** Create Folder with Arabic Name using ListData.svc in SharePoint 2016. **

I am Using ListData.svc to create folder:

// my C# code
var path = pURL + sourceFolder + "/" + folderName;
var contentTypeId = "0x012000F069FA9A45983BE";

client = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true });
client.BaseAddress = new System.Uri(pURL);
client.DefaultRequestHeaders.Clear();

client.DefaultRequestHeaders.Add("Accept", "application / json; charset=utf-8");
client.DefaultRequestHeaders.Add("Slug", path + "|" + contentTypeId);

var responseCreate = client.PostAsync("_vti_bin/listdata.svc/" + sourceFolder, null).Result;

As written in the code I am using custom Content Type, sending the contentTypeId with the “Slug” header.

Everything work fine, when the folder name in English e.g.

path = http://sp2016:5841/RMSDoc/Activities/My NewFolder; // this work fine.

The issue when I am trying to create new folder with Arabic name e.g.

path = http://sp2016:5841/RMSDoc/Activities/مجلد جديد; // this not work fine.

Anyone can help!

Iyad
  • 1
  • What do you mean with 'this does not work fine'? Do you get an error message, or does something else happen? Either way, as far as I know non-ASCII characters in urls must be url-encoded. Have you tried that? – Pieter Witvoet Jul 27 '16 at 09:56
  • {StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: – Iyad Jul 27 '16 at 10:29
  • error details : Id = 3330, Status = RanToCompletion, Method = "{null}", Result = "{\r\n\"error\": {\r\n\"code\": \"\", \"message\": {\r\n\"lang\": \"en-US\", \"value\": \"An error occurred while processing this request.\"\r\n}\r\n}\r\n}" System.Threading.Tasks.Task – Iyad Jul 27 '16 at 10:32
  • @PieterWitvoet even after encoded the acabic text : I got the same error – Iyad Jul 27 '16 at 10:40

0 Answers0