1

I have a website which allows users to input usernames.

The problem here is that the code in c++ assumes the browser encoding is Western Europe and converts the string received from the username text box into unicode to compare with string stored within the databasse.

with the right browser encoding set the character úser is recieved as %FAser and coverted properly to úser within the program however with the browser settings set to UTF-8 the string is recieved as %C3%BAser and then converted to úser due to the code converting C3 and BA as seperate characters.

Is there a way to convert the example %c3%BA to ú while ensuring the right conversions are being made?

4

1 回答 1

3

您可以使用ICU 库在几乎所有可用的编码之间进行转换。该库还提供了许多字符串操作工具。

于 2013-08-29T11:33:30.993 回答