[%C7%D7%B1%B8 = Port] <- Unicode like this? What is the notation called?

Asked 2 years ago, Updated 2 years ago, 49 views

[%C7%D7%B1%B8 = Port] <- This kind of Unicode? What is the notation called?

As the file is moved from Windows to Linux, it is assumed that all the Korean file names are translated like that.

Maybe it's an encoding problem, but it's the same problem because there's a difference between two bytes in Windows and one or two variable bytes in Linux.

I have to create a Windows program that automatically converts such sentences into normal Korean due to circumstances.

To do that, I need to know the conversion rules, but I can't find them because I don't know what they call them even if I try to search them.

Please tell me the name of that string notation.

And I think there may already be libraries or other things that convert that into Korean, so if you know anything, please share information.

string

2022-09-22 12:57

1 Answers

The encoding is euc-kr

The byte value.

>>> ss = 'Port'
>>> ss.encode('euc-kr')
b'\xc7\xd7\xb1\xb8'
>>> import urllib.parse
>>> urllib.parse.unquote('%C7%D7%B1%B8', encoding='euc-kr')
"Harbour"


2022-09-22 12:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.