Question

I faced a strange problem while coding a Turkish site... In my vb.net code I use a vb function StrConv(s, VbStrConv.ProperCase) where s is the string that needs to be propercased. For the Turkish site, the "ı" character is not properly propercased. Do you have any ideas how to solve this? Thanks.

Was it helpful?

Solution

This (infamous) case is known as the Turkish I Problem. Jeff Atwood has written about it: What's wrong with Turkey? If you uppercase a Turkish lowercase dotless i, it becomes the uppercase English I. Then, if you lowercase that, it becomes an English lowercase dotted i. (That is, the operation is not commutative.) See this link for the solution.

OTHER TIPS

As I recall the Turkish "ı" is one of the two cases where converting to upper case and then back to lower case again will not yield the original string. The other one is the German sharp "s" (i.e. ß).

What exactly is the result of the StrConv call?

Are you a native Turkish speaker and do you expect a specific result? If Yes: There might be a bug in the .NET CLR. Then please post the exact .NET version you are using.

Otherwise the result might be perfectly fine even though it looks strange for a non-Turkish user.

I'm German so for the German sharp s: There is no upper case ß. Lower case is "ß". Convert to upper case: "SS". And back to lower case: "ss"

FileReader = New StreamReader(OpenFileDialog1.FileName, Encoding.Default)

Encoding.Default solves this problem in vb.net

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top