Description of the problem: The context I have to upload a file into sharepoint programmatically. To do that i have to call âAddâ function on the chosen folder or list and passing as parameter the url of the file. The problem I have to write the url programmatically and when I mix English and Hebrew I donât obtain the wanted url. Sample: I want to add a file named âtest.docxâ in the location http://myserver/mylist/myfolder/. In my case I get the file name programmatically by looping into a folder in my local computer. So in my code I have to write : string filename=myFileName( sample: âtest.docxâ) string UrlLocation= http://myserver/mylist/ת××§×××â; String Url=UrlLocation+filename; myFolder.Add(Url); The problem is that for the Url I obtain this value : http://myserver/mylist/ test / ת××§×××.docx and not : http://myserver/mylist/ ת××§××× / test.docx . In fact the â/â character disturb the concatenation. I have already tested : StringBuilder, Encoding, bidi32.dll without success. Thanks for help
Hi, maybe you can try Path.Combine ( http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx ). Vicenç "mikomarseillais" wrote: > Description of the problem: > > The context > > I have to upload a file into sharepoint programmatically. > To do that i have to call âAddâ function on the chosen folder or list and > passing as parameter the url of the file. > > The problem > > I have to write the url programmatically and when I mix English and Hebrew I > donât obtain the wanted url. > > Sample: > > I want to add a file named âtest.docxâ in the location > http://myserver/mylist/myfolder/. > In my case I get the file name programmatically by looping into a folder in > my local computer. > > So in my code I have to write : > > string filename=myFileName( sample: âtest.docxâ) > string UrlLocation= http://myserver/mylist/ת××§×××â; > String Url=UrlLocation+filename; > myFolder.Add(Url); > > The problem is that for the Url I obtain this value : > http://myserver/mylist/ test / ת××§×××.docx and not : http://myserver/mylist/ > ת××§××× / test.docx . > In fact the â/â character disturb the concatenation. > > I have already tested : StringBuilder, Encoding, bidi32.dll without success. > > Thanks for help
Hi Vincent, Thanks for your help. I tested your idea but it doesn't work. I found in a forum of Microsoft that there are no function in the .Net framework to convert between Hebrew logical and visual layouts : https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=195951&wa=wsignin1.0 I hope there is a solution because i thinks that developpers who work with right to left langages have solved this problem. All ideas are welcome. Thanks. "Vincent" wrote: > Hi, > > maybe you can try Path.Combine ( > http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx ). > > Vicenç > > "mikomarseillais" wrote: > > > Description of the problem: > > > > The context > > > > I have to upload a file into sharepoint programmatically. > > To do that i have to call âAddâ function on the chosen folder or list and > > passing as parameter the url of the file. > > > > The problem > > > > I have to write the url programmatically and when I mix English and Hebrew I > > donât obtain the wanted url. > > > > Sample: > > > > I want to add a file named âtest.docxâ in the location > > http://myserver/mylist/myfolder/. > > In my case I get the file name programmatically by looping into a folder in > > my local computer. > > > > So in my code I have to write : > > > > string filename=myFileName( sample: âtest.docxâ) > > string UrlLocation= http://myserver/mylist/ת××§×××â; > > String Url=UrlLocation+filename; > > myFolder.Add(Url); > > > > The problem is that for the Url I obtain this value : > > http://myserver/mylist/ test / ת××§×××.docx and not : http://myserver/mylist/ > > ת××§××× / test.docx . > > In fact the â/â character disturb the concatenation. > > > > I have already tested : StringBuilder, Encoding, bidi32.dll without success. > > > > Thanks for help