[pdal] Non-English characters

Andrew Bell andrew.bell.ia at gmail.com
Wed Jan 17 05:50:50 PST 2018


I still haven't seen code that shows a UTF-8 string being passed to PDAL as
a filename and PDAL failing to handle it.  Something like this would help:

void main()
{
  LasReader r;
  Options ro;
  ro.add("filename", "some filename that causes a problem")

  PointTable t;
  r.prepare(t);
  r.execute(t);
  std::cerr << Utils::toJSON(r.getMetadata());
}

Does something like this fail?  If not, can you provide an example?  I
can't help unless I understand the problem.

Thanks,


On Wed, Jan 17, 2018 at 5:31 AM, <pidgeon13 at googlemail.com> wrote:

> The two methods are producing the same std::string for me. I’m fairly sure
> that specifying the code page in CW2A overrides using the ANSI codepage.
>
>
>
> Regards,
>
>
>
> STephen
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Mateusz Loskot <mateusz at loskot.net>
> *Sent: *17 January 2018 10:21
>
> *To: *pidgeon13 at googlemail.com
> *Cc: *Andrew Bell <andrew.bell.ia at gmail.com>; pdal at lists.osgeo.org
> *Subject: *Re: [pdal] Non-English characters
>
>
>
> CUtils::toUtf8 looks fine to me
>
>
>
> On 17 January 2018 at 11:17,  <pidgeon13 at googlemail.com> wrote:
>
> > I have included another piece of code, which is what I tried first using
>
> > WideCharToMultiByte. Should this perform the conversion correctly?
>
> >
>
> >
>
> >
>
> > Regards,
>
> >
>
> >
>
> >
>
> > Stephen
>
> >
>
> >
>
> >
>
> > Sent from Mail for Windows 10
>
> >
>
> >
>
> >
>
> > From: Mateusz Loskot
>
> > Sent: 17 January 2018 10:09
>
> >
>
> >
>
> > To: pidgeon13 at googlemail.com
>
> > Cc: Andrew Bell; pdal at lists.osgeo.org
>
> > Subject: Re: [pdal] Non-English characters
>
> >
>
> >
>
> >
>
> > See what the docs [1] say about the A in CW2A.
>
> >
>
> >
>
> >
>
> > Meanwhile, you need to use WideCharToMultiByte [2] with CP_UTF8 code
> page.
>
> >
>
> >
>
> >
>
> > [1] https://msdn.microsoft.com/en-us/library/87zae4a3.aspx
>
> >
>
> > [2] https://msdn.microsoft.com/en-us/library/windows/desktop/
> dd374130.aspx
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > On 17 January 2018 at 11:02,  <pidgeon13 at googlemail.com> wrote:
>
> >
>
> >> std::string sFilePath = CW2A(filepath, CP_UTF8);
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> Regards,
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> Stephen
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> Sent from Mail for Windows 10
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> From: Mateusz Loskot
>
> >
>
> >> Sent: 17 January 2018 10:00
>
> >
>
> >> To: pidgeon13 at googlemail.com
>
> >
>
> >> Cc: Andrew Bell; pdal at lists.osgeo.org
>
> >
>
> >> Subject: Re: [pdal] Non-English characters
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> On 17 January 2018 at 10:31,  <pidgeon13 at googlemail.com> wrote:
>
> >
>
> >>
>
> >
>
> >>>
>
> >
>
> >>
>
> >
>
> >>> The user browses for a file in a dialog file browser, and I convert
> this
>
> >
>
> >>
>
> >
>
> >>> string to UTF-8
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> How do you convert to UTF-8?
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> Please, you need to show some code (one image for 1000 words).
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >> Best regards,
>
> >
>
> >>
>
> >
>
> >> --
>
> >
>
> >>
>
> >
>
> >> Mateusz Loskot, http://mateusz.loskot.net
>
> >
>
> >>
>
> >
>
> >>
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > --
>
> >
>
> > Mateusz Loskot, http://mateusz.loskot.net
>
> >
>
> >
>
>
>
>
>
>
>
> --
>
> Mateusz Loskot, http://mateusz.loskot.net
>
>
>



-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20180117/b2549d1c/attachment-0001.html>


More information about the pdal mailing list