2012-01-23 11 views
0

I am developing a web application by using ASP.NET/ C#and AZURE。 I am using Azure Blob to store files。 I face a problem to store a file with other languages(Only English is OK)。How to support other languages in Azure blob storage?

Example: I save this as a .txt file:「ハンナラ党大会金の封筒事件を捜査している検察がパク・ヒテ国会議長秘書官オフィスを電撃押収捜索しました。調整が、イボンゴン二首席秘書官室秘書ハムモ氏が勤務する付属室です。ソウル中央地検公安1部は、今日(19日)の朝8時20分、ソウル汝矣島」

but when I retrive this、its shows:「í•œë,~ë¼ë<¹ì " ë<¹ëŒ€íšŒëë'‰í¬ì,¬ê±'ì "ì~ì,¬í•~ê³ìžëŠ「검찰ì'ë°•í¬íƒœêμ회ì~장ë¹"ì 「œê'€ì,¬ë¬'ì<¤ì "ì"격압ì~ì~색í-ìŠμë<ë<¤。 ì¡°ì•ë§Œ、ì'ë'‰ê±「ë」ì~ì "ë¹"ì "œê'€ì<¤ê³¼ì-¬ë¹"ì "œí•¨ëª¨ì"¨ ê°€ê・¼ë¬'í•~ëŠ「부ì†ì<¤ìž...ë<ë<¤。ì "œìš¸ì¤'앙지검ê³μì•1ë¶€ëŠ 「ì~¤ëŠ~(19ì¼)ì• "침8ì<œ20ë¶"ì "œìš¸ì-¬ì~ë" "

What is the problem?

Thanks
Nahid

+1

This is nothing to do with Azure、this is a text encoding issue。 – Chandermani

+1

@Chandermani is correct I think。 Could you try to specify UTF-8 or UTF-16 when you read the file back? On disk files have a BOM that tells the reader what encoding the file has、but I suspect this is lost or ignored when you download the file from the blob。 –

答えて

2

You have to save your text files in UTF format(not ASCII)。

UPDATE after @naruse comment

And you have to specify the content type property for the blob including the charset。 I do that for cyrillic alphabet and it works perfectly。 There shall not be issues with Korean one。

If it is a plain text file、the proper value for Content Type should be:

text/plain; charset=utf-8

Or the charset you naturally use。

+0

I use this。 but its not working:1. blob.Properties.ContentType = Encoding.UTF8.HeaderName; 2. blob.Properties.ContentType = "charset = utf-8"; 3 blob.Properties.ContentLanguage = Encoding.UTF8.HeaderName; But Its not working。 – Nasir

+1

how about the file itself。 Not only the blob properties。 Did you try saving the file with some "Advanced" text editor such as NodePad ++ or UltraEdit、or anything that support UTF8 encoding? So you could explicitly set Unicode encoding for the file itself。 Try with and witout BOM(Byte Order Mask)。 – astaykov

+0

Thanks all for reply – Nasir