Comments (6)
This might or might not be fixed by the latest encoding changes, can you verify
and if not provide a file as a test case…
from translate.
Tested this using:
pogrep -e “[ḒḓḼḽṄṅṊṋṰṱ]” —errorlevel=traceback ve duh
(All Venda special characters. And it works.
Then again with:
pogrep “ṅ” —errorlevel=traceback ve duh
(n with a dot above)
Everything works correctly
from translate.
If the files contains no valid PO header and the contents contains non ascii
characters then the grep will fail.
We should fail more gracefully with a warning about the missing header.
from translate.
Created [attachment 52](http://bugs.locamotion.org/attachment.cgi?id=52)
Small segment of headerless PO file with Unicode chars
[dwayne@laptop-wifi ve]$ pogrep —search=msgstr “ṇ”
—errorlevel=traceback browser-head.po browser-grep.po
processing 1 files…
pogrep: warning: Error processing: input browser-head.po, output
browser-grep.po, template None: Traceback (most recent call last):
418, in recursiveprocess
success = self.processfile(fileprocessor, options, fullinputpath,
fulloutputpath, fulltemplatepath)
471, in processfile
if fileprocessor(inputfile, outputfile, templatefile,
**passthroughoptions):
in runpogrep
tofile = checkfilter.filterfile(fromfile)
in filterfile
matches = self.filterelement(thepo)
in filterelement
if self.matches(unquotedstr): return True
in matches
found = teststr.find(self.searchstring) != -1
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe1 in position 5: ordinal
not in range(128)
from translate.
pogrep is now fine – HEAD when we grep for headerless entries in non regexp mode.
However, if you search using —regexp with a Unicode search string then it fails
to detect a matching unicode entry in the Message Unit.
from translate.
The changes to manage headerless files that Friedel committed (I think) has
fixed this problem.
The encoding of search strings has been manage by forcing a decode from UTF-8.
This will create problems for anyone not using UTF-8. We’ll fix that when teh
problem arrises.
from translate.
Related Issues (20)
- po2csv - I didn't find it in the documentation and it ignores context
- po2rc should preserve comments location
- test_odf_xliff changes working directory and does not change it back, breaking other tests
- Unable to make tests pass locally - pycountry triggers DeprecationWarning with pkg_resources HOT 3
- translate-toolkit-3.9.2-1.fc39.x86_64/usr/bin/mozfunny2prop --manpage hangs HOT 4
- Extract only text from IDML by idml2po
- support several input parameters for pofilter (and other commands)
- Support for Android resource converter HOT 4
- prop2po: support for different encodings for both the input file and the template
- prop2po: personality given in command line is ignored for .strings files HOT 2
- Locate tests and test data outside 'translate' module HOT 2
- Ben
- Android: Some strings marked as `translatable="false"` still treated as translatable HOT 2
- Code block not parsed from Markdown HOT 3
- Proposal to use mdit-py-i18n (along with markdown-it-py) for Markdown support HOT 7
- Reduce question mark escaping in Android
- tests/translate/convert/test_rc2po.py failures with Python 3.12 HOT 7
- Translate
- Use Windows newlines for resx files
- Do not include "Explanation" field in iOS strings files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate.