-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding error using Get-CosmosDbDocument #282
Comments
Hi @runeemde - thank you for raising this. I thought I had tests covering this, but I only have them checking if the ID is UTF-8 (https://github.com/PlagueHO/CosmosDB/blob/dev/test/Integration/CosmosDB.integration.Tests.ps1#L1073) - it doesn't check the body. Are you able to paste a sample payload here (with no sensitive data) and I'll use it as a test case to prepare a fix against. I'll take a look at this tonight. |
Hi @PlagueHO, Thank you for the quick response. The picture below shows my cosmos document with a property data "sdsføæå" |
Awesome! Thanks @runeemde. I'll take a look tonight and get it sorted for you. |
Hi @runeemde - I've found and fixed the problem. It was actually caused by a really old PowerShell issue: https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/13685217-invoke-restmethod-and-invoke-webrequest-encoding-b I've just got a bit of clean up/refactoring to do to correct it, but I'm aiming to have this out tomorrow for you. |
Thanks for quick response @PlagueHO, looking forward to the update! |
I have submitted a PR to fix this and I'll merge it tomorrow if all the tests pass: |
Fix Encoding bug in Get-CosmosDbDocument - Fixes #282
Just releasing this now. Should be out in a few hours. |
It has been released to the PS Gallery: https://www.powershellgallery.com/packages/CosmosDB/3.2.3.359 |
Thank you for your quick response, I've testet it with my issue and everything worked great. Thanks a million, have a great weekend! |
My pleasure @runeemde - glad to help 😁 |
Hi,
I'm using special characters and have no problem saving them to the cosmos database using UTF-8 encoding.
New-CosmosDbDocument -Context $cosmosDbContext -Database $databaseId -CollectionId $collectionId -DocumentBody $documentStr -Encoding UTF-8
When the data are retrieved again the data is not UTF-8 any more.
Get-CosmosDbDocument -Context $cosmosDbContext -Database $databaseId -CollectionId $collectionId -Id $documentId
The text was updated successfully, but these errors were encountered: