OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

osgDB XmlParser and localization


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Trajce Nikolov NICK
Guest





PostPosted: Mon Jul 09, 2018 10:41 am    Post subject:
osgDB XmlParser and localization
Reply with quote

Hi Robert,

I am working with some localized XML files (with chars out of 0-255 range) and at present the XML Node parsing is not suitable to manage it. And I think the support for is important - at my case it is OpenStreetMap with street names containing these chars.


Attached is the modified source (based on the master) that fixes ity, if you have time and will to review. I can do PR if you want


Thanks and cheers!


Nick


p.s. welcome back

--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Mon Jul 09, 2018 11:10 am    Post subject:
osgDB XmlParser and localization
Reply with quote

Hi Nick,

I had a quick look at your changes and it seems to be like most of
them are changes for changes sake rather than likely to make any
functional difference. For non ascii char support I think what you'd
actually want to do is change the XmllNode::Input::string _buffer
member var to a std::vector<int> _buffer, and have the
Input::readAllDataIntoBuffer() method be adapted to read the file
accepting only chars greater than 0 rather than limiting to the ascii
0 to 255 range.

Robert.
On Mon, 9 Jul 2018 at 11:41, Trajce Nikolov NICK
<> wrote:
Quote:

Hi Robert,

I am working with some localized XML files (with chars out of 0-255 range) and at present the XML Node parsing is not suitable to manage it. And I think the support for is important - at my case it is OpenStreetMap with street names containing these chars.

Attached is the modified source (based on the master) that fixes ity, if you have time and will to review. I can do PR if you want

Thanks and cheers!

Nick

p.s. welcome back

--
trajce nikolov nick



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Trajce Nikolov NICK
Guest





PostPosted: Mon Jul 09, 2018 11:27 am    Post subject:
osgDB XmlParser and localization
Reply with quote

hi Robert,

Quote:
  .... are changes for changes sake rather than likely to make anyfunctional difference



I knew you will have comments Wink. It works just fine with these changes but yes, you are right - quick and somewhat dirty. So can you look at it or you want to do a ping-pong code review with my changes by your advice? Smile


Please let me know


Nick


On Mon, Jul 9, 2018 at 1:09 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Nick,

I had a quick look at your changes and it seems to be like most of
them are changes for changes sake rather than likely to make any
functional difference.  For non ascii char support I think what you'd
actually want to do is change the XmllNode::Input::string _buffer
member var to a std::vector<int> _buffer, and have the
Input::readAllDataIntoBuffer() method be adapted to read the file
accepting only chars greater than 0 rather than limiting to the ascii
0 to 255 range.

Robert.
On Mon, 9 Jul 2018 at 11:41, Trajce Nikolov NICK
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:

Hi Robert,

I am working with some localized XML files (with chars out of 0-255 range) and at present the XML Node parsing is not suitable to manage it. And I think the support for is important - at my case it is OpenStreetMap with street names containing these chars.

Attached is the modified source (based on the master) that fixes ity, if you have time and will to review. I can do PR if you want

Thanks and cheers!

Nick

p.s. welcome back

--
trajce nikolov nick
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Mon Jul 09, 2018 11:50 am    Post subject:
osgDB XmlParser and localization
Reply with quote

Hi Nick,

On Mon, 9 Jul 2018 at 12:26, Trajce Nikolov NICK
<> wrote:
Quote:
Quote:
.... are changes for changes sake rather than likely to make any
functional difference

I knew you will have comments Wink. It works just fine with these changes but yes, you are right - quick and somewhat dirty. So can you look at it or you want to do a ping-pong code review with my changes by your advice? Smile

I might be quicker just to provide a link to or attach an xml file
that causes problem with the present parser, and then I can look at
what happens when the present code encounters it, and how your changes
affect things.

As a general note, PRs/commits should be focused on addressing one
issue at a time, so bundling a fix for a specific bug along with other
cosmetic or other changes just confuses what is functional and what is
not. It's not uncommon to have to go back to various revisions in
code to see where regressions may have occurred so having commits that
just wrap up a small set of associated changes is really helpful in
identifying what has been changed and why.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Trajce Nikolov NICK
Guest





PostPosted: Mon Jul 09, 2018 11:59 am    Post subject:
osgDB XmlParser and localization
Reply with quote

Hi again Robert,

fast hint: The nodes to be parsed are root->osm->node->tag and their properties contains these non asci codes. But probably fastest is to write recursive parser


Thanks again


On Mon, Jul 9, 2018 at 1:54 PM Trajce Nikolov NICK < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Thanks so much Robert !!! Attached is the file





On Mon, Jul 9, 2018 at 1:50 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Nick,

On Mon, 9 Jul 2018 at 12:26, Trajce Nikolov NICK
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Quote:
  .... are changes for changes sake rather than likely to make any
functional difference

I knew you will have comments Wink. It works just fine with these changes but yes, you are right - quick and somewhat dirty. So can you look at it or you want to do a ping-pong code review with my changes by your advice? Smile

I might be quicker just to provide a link to or attach an xml file
that causes problem with the present parser, and then I can look at
what happens when the present code encounters it, and how your changes
affect things.

As a general note, PRs/commits should be focused on addressing one
issue at a time, so bundling a fix for a specific bug along with other
cosmetic or other changes just confuses what is functional and what is
not.  It's not uncommon to have to go back to various revisions in
code to see where regressions may have occurred so having commits that
just wrap up a small set of associated changes is really helpful in
identifying what has been changed and why.

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick




--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
Trajce Nikolov NICK
Guest





PostPosted: Mon Jul 09, 2018 12:10 pm    Post subject:
osgDB XmlParser and localization
Reply with quote

Thanks so much Robert !!! Attached is the file





On Mon, Jul 9, 2018 at 1:50 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Nick,

On Mon, 9 Jul 2018 at 12:26, Trajce Nikolov NICK
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Quote:
  .... are changes for changes sake rather than likely to make any
functional difference

I knew you will have comments Wink. It works just fine with these changes but yes, you are right - quick and somewhat dirty. So can you look at it or you want to do a ping-pong code review with my changes by your advice? Smile

I might be quicker just to provide a link to or attach an xml file
that causes problem with the present parser, and then I can look at
what happens when the present code encounters it, and how your changes
affect things.

As a general note, PRs/commits should be focused on addressing one
issue at a time, so bundling a fix for a specific bug along with other
cosmetic or other changes just confuses what is functional and what is
not.  It's not uncommon to have to go back to various revisions in
code to see where regressions may have occurred so having commits that
just wrap up a small set of associated changes is really helpful in
identifying what has been changed and why.

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
Trajce Nikolov NICK
Guest





PostPosted: Fri Aug 31, 2018 7:07 am    Post subject:
osgDB XmlParser and localization
Reply with quote

Hi Robert,


can you fix this too when you get back to OSG dev please?


Thank you a bunch
Nick



On Mon, Jul 9, 2018 at 1:58 PM Trajce Nikolov NICK < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi again Robert,

fast hint: The nodes to be parsed are root->osm->node->tag and their properties contains these non asci codes. But probably fastest is to write recursive parser


Thanks again


On Mon, Jul 9, 2018 at 1:54 PM Trajce Nikolov NICK < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Thanks so much Robert !!! Attached is the file





On Mon, Jul 9, 2018 at 1:50 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Nick,

On Mon, 9 Jul 2018 at 12:26, Trajce Nikolov NICK
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Quote:
  .... are changes for changes sake rather than likely to make any
functional difference

I knew you will have comments Wink. It works just fine with these changes but yes, you are right - quick and somewhat dirty. So can you look at it or you want to do a ping-pong code review with my changes by your advice? Smile

I might be quicker just to provide a link to or attach an xml file
that causes problem with the present parser, and then I can look at
what happens when the present code encounters it, and how your changes
affect things.

As a general note, PRs/commits should be focused on addressing one
issue at a time, so bundling a fix for a specific bug along with other
cosmetic or other changes just confuses what is functional and what is
not.  It's not uncommon to have to go back to various revisions in
code to see where regressions may have occurred so having commits that
just wrap up a small set of associated changes is really helpful in
identifying what has been changed and why.

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick




--
trajce nikolov nick



--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Tue Sep 04, 2018 2:42 pm    Post subject:
osgDB XmlParser and localization
Reply with quote

On Fri, 31 Aug 2018 at 08:06, Trajce Nikolov NICK
<> wrote:
Quote:
can you fix this too when you get back to OSG dev please?

This morning I have checked in UTF8 handling in XmlNode/Input to
master and the 3.6 branch.

https://github.com/openscenegraph/OpenSceneGraph/commit/afe5644b9fcf39a22a2ba0c8aefb26a340a5a457

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Trajce Nikolov NICK
Guest





PostPosted: Tue Sep 04, 2018 9:12 pm    Post subject:
osgDB XmlParser and localization
Reply with quote

Thanks a bunch Robert!

I will check it first thing tomorrow morning


On Tue, Sep 4, 2018 at 4:40 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
On Fri, 31 Aug 2018 at 08:06, Trajce Nikolov NICK
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
can you fix this too when you get back to OSG dev please?

This morning I have checked in UTF8 handling in XmlNode/Input to
master and the 3.6 branch.

https://github.com/openscenegraph/OpenSceneGraph/commit/afe5644b9fcf39a22a2ba0c8aefb26a340a5a457

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts osgDB::OutputStream write array optim... Farshid Lashkari Submission 2 Thu Sep 20, 2018 11:17 pm View latest post
No new posts Load OSG trimesh to ODE: Read Vertice... TKoller General 2 Fri Jul 20, 2018 3:06 pm View latest post
No new posts osgDB::readRefNodeFiles() crashes wit... peter_k General 4 Fri Jun 08, 2018 9:18 am View latest post
No new posts Bug in osgDB::findFileInDirectory Riccardo Corsi General 6 Tue Mar 27, 2018 4:19 pm View latest post
No new posts Opening .ico image files with osgDB::... ceranco General 1 Wed Mar 07, 2018 7:41 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP