added fetch get example for non-utf8 pages#2911
Conversation
|
Are there many pages in non-UTF in Korean (or Chinese)? Is it a common way of using |
Yes. At least there are many Korean and Japanese websites that are not in UTF8, especially for some government websites. For Chinese, I don't have much experience. In practice, many people struggle with encodings when accessing those websites programatically. Ideally, the owners of those websites should follow international standards. However, in most cases they don't want to change, or just give up management. From the user point of view, we want to deal with what's inside rather than the charset encoding. Therefore, this example will be meaningful for beginners to utilize without a deeper understanding on non-UTF8 encodings.
I agree that this is not the intended usage of |
|
So, for non-UTF Korean websites, when people use How did they cope before |
|
up ) |
Still, some webpages do not follow standard UTF-8 encoding. As far as I know,
fetch()does not support encoding options by default. Therefore, I added an example with error handling part (not already shown).