Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Sebastian
> > This works fine as long as they are in English: > > "??? is not a valid  value for BrowseNodeId. > >  >  Please change this value and retry your request.", >  > for instance, will raise an InvalidParameterValue > > > exception. However, the Japanese version returns the error message "??? > > は、

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Terry Reedy
On 4/21/2010 5:31 AM, Sebastian wrote: This works fine as long as they are in English: "??? is not a valid value for BrowseNodeId. > Please change this value and retry your request.", > for instance, will raise an InvalidParameterValue exception. However, the Japanese version returns the err

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Terry Reedy
On 4/21/2010 7:46 AM, Sebastian wrote: The Amazon API returns an XML response which contains error messages if a request fails. These messages consist of an error code and an error description in natural language. Luckily, the description seems to stick to the same format and is (in all but one

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Chris Rebert
On Wed, Apr 21, 2010 at 4:46 AM, Sebastian wrote: >> > My regular expressions turn the Amazon error messages into Python >> > exceptions. >> >> > This works fine as long as they are in English: "??? is not a valid >> > value for BrowseNodeId. Please change this value and retry your >> > request.",

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Sebastian
> > My regular expressions turn the Amazon error messages into Python > > exceptions. > > > This works fine as long as they are in English: "??? is not a valid > > value for BrowseNodeId. Please change this value and retry your > > request.", for instance, will raise an InvalidParameterValue > > ex

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Ben Finney
Sebastian writes: > My regular expressions turn the Amazon error messages into Python > exceptions. > > This works fine as long as they are in English: "??? is not a valid > value for BrowseNodeId. Please change this value and retry your > request.", for instance, will raise an InvalidParameterVa

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Sebastian
> General advice with character sets in Python apply: always explicitly > declare the encoding of input, then decode to Unicode interally as early > as possible, and process all text that way. Only fix into an encoding > when it's time to output. Maybe I was too vague when describing my problem. A

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-21 Thread Chris Rebert
On Tue, Apr 20, 2010 at 9:52 PM, Ben Finney wrote: > Sebastian writes: >> All locales return error messages in English. Only the Japanese uses >> Japanese which my regular expressions cannot handle at the moment. > > What exactly are you expecting to happen, and what exactly happens > instead? >

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-20 Thread Ben Finney
Sebastian writes: > All locales return error messages in English. Only the Japanese uses > Japanese which my regular expressions cannot handle at the moment. What exactly are you expecting to happen, and what exactly happens instead? General advice with character sets in Python apply: always ex

Japanese (speaking) developer needed for a bit of regex magic

2010-04-20 Thread Sebastian
Hi all, I'm working on Python bindings for the Amazon Product Advertising API (http://pypi.python.org/pypi/python-amazon-product-api/) which supports the different localised versions - among them a Japanese one (for http://www.amazon.co.jp). All locales return error messages in English. Only the