Closed dingyifei closed 3 years ago
Thank you for the report @dingyifei, I'm reproducing it here and will try to investigate asap ๐๐ผ
For the encoding problem, could you upgrade your mdpo version? It seems that you are using mdpo==0.3.19
.
The newer version changed a bit but is having the same error
Thank you for improving mdpo!
I think po2md also has a similar issue. Sorry for missing it earlier. It seems like the same issue just in a different place.
The following issue occurred in Action
Action yml:
name: Update Locales
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install MDPO
run: pip install mdpo
- name: generate file
run: touch a.md
- name: Insert Text
run: echo "helloworld" >> a.md
- name: test1
run: md2po ./a.md
- name: test2
run: python -c "import os;print(os.path.exists('a.md'));"
- name: test3
run: cat ./a.md | md2po
- name: test4
run: cat ./a.md | md2po -s --po-filepath a.po && cat ./a.md | po2md -p a.po
- name: test5
run: cat ./a.md | md2po -s --po-filepath a.po && po2md a.md -p a.po
I think po2md also has a similar issue...
Thank you for catching it. It's fixed in v0.3.57.
I'm trying to use > filename to bypass the md2po read file issue, and it works for most of the files except a few ones.
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc93' in position 1705: surrogates not allowed
Hi @dingyifei, could you point what is the file that is raising this error?
More than one file has this error. One of them is
HallFilamentWidthSensor.po.txt input md: HallFilamentWidthSensor.md output md: HallFilamentWidthSensor.md
command:
cat $mdfilepath | po2md --md-encoding utf-8 --po-encoding utf-8 \
-p $pofilepath -q -s $targetmdfile
I'm not able to reproduce it with > at this point (I messed up my script), but using cat filename | po2md
does the trick.
Additionally, I observed some problem with old markdown outputs can't be correctly updated (so I added an rm command in my script). It doesn't affect rendering though. Should I create a new issue regarding this behavior?
I can't reproduce it. The original error was produced due to an unencodable surrogate, which I think that should be considered an invalid input. Maybe, you can share the encoding that is using your terminal? Additionally, to be sure, what version of mdpo are you using?
Additionally, I observed some problem with old markdown outputs can't be correctly updated (so I added an rm command in my script). It doesn't affect rendering though. Should I create a new issue regarding this behavior?
Yes, why not? ๐๐ผ
Version: po2md 0.3.66 terminal settings: I believe it is running UTF-8 because the Chinese characters are being properly handled. I'll try to reproduce the markdown update inconsistency issue when I get enough time.
I'm not sure how, but it seems like the old markdown files are being updated correctly now. It's probably fixed in the link wrap fix or some other related fixes. I remember it was inserting extra empty lines (I think I had a screenshot somewhere) and ignoring wrap width on the first line of a paragraph.
Could it be the MingW64 used by Git Bash being so ridiculously different? This is a strange result
I'm not able to reproduce in MinGW64. Maybe your version have that problem with PIPES. As this works everywhere except inside your version of MinGW64, I'm closing this.
I don't have permission to reopen #125, but I found some additional information that might indicate the underlying issue.
This test Action can run on any repo update_locales.yml.txt
It produces the following result
Looks like the way md2po read files could be causing the issue.
I modified my script to do something as the following
< $mdfilepath md2po --md-encoding utf-8 --po-encoding utf-8 -e utf-8 -w $width -q -s -c --po-filepath $pofilepath
When I ran this script an encoding issue occurred.I'm trying to use
> filename
to bypass the md2po read file issue, and it works for most of the files except a few ones.