Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unicode error #103

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

azlarsin
Copy link

Source: https://github.com/website-scraper/node-website-scraper?tab=readme-ov-file#afterresponse.

a binary string. This is advised against because of the binary assumption being made can foul up saving of utf8 responses to the filesystem.

Test page: http://www.csxykj.com/mobile/index.html

Before: <h3>磁致伸缩位移�&nbsp;感器</h3>, <h5>影响大跨度桥梁施工控制的�&nbsp;�&nbsp;</h5>.

After: <h3>磁致伸缩位移传感器</h3>, <h5>影响大跨度桥梁施工控制的因素</h5>.

@azlarsin azlarsin closed this May 11, 2024
@azlarsin azlarsin reopened this May 11, 2024
// https://github.com/website-scraper/node-website-scraper?tab=readme-ov-file#afterresponse: (binary) This is advised against because of the binary assumption being made can foul up saving of utf8 responses to the filesystem.
return {
body: content,
encoding: 'utf8'
Copy link
Member

@aivus aivus Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s0ph1e Should we do the same we did in website-scraper?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @azlarsin,
thank you for your contribution 👍 and sorry for the very late response from my side.

Hi @aivus,
thank you for pinging me. I think, it's a good idea to use the same approach, that already exists in the main module. It would also be nice to have some tests for it (we can use an example in the PR comment).

@aivus aivus mentioned this pull request Sep 20, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants